[TASK] change default listing address to ff05::2:1001

take a look at: 59a44274cb
This commit is contained in:
Martin/Geno 2019-05-03 17:35:15 +02:00
parent 99443cb144
commit 31267858a6
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
6 changed files with 13 additions and 13 deletions

View File

@ -20,7 +20,7 @@ Yet another node info collector
## How it works ## How it works
In the first step Yanic sends a multicast message to the group `ff02:0:0:0:0:0:2:1001` and port `1001`. In the first step Yanic sends a multicast message to the group `ff05:0:0:0:0:0:2:1001` and port `1001`.
Recently seen nodes that does not reply are requested via a unicast message. Recently seen nodes that does not reply are requested via a unicast message.
## Documentation ## Documentation

View File

@ -23,14 +23,14 @@ domains = ["city"]
# name of interface on which this collector is running # name of interface on which this collector is running
ifname = "br-ffhb" ifname = "br-ffhb"
# ip address which is used for sending # ip address which is used for sending
# (optional - without definition used a address of ifname) # (optional - without definition used a address of ifname - prefered link local)
ip_address = "fd2f:5119:f2d::5" ip_address = "fd2f:5119:f2d::5"
# disable sending multicast respondd request # disable sending multicast respondd request
# (for receiving only respondd packages e.g. database respondd) # (for receiving only respondd packages e.g. database respondd)
#send_no_request = false #send_no_request = false
# multicast address to destination of respondd # multicast address to destination of respondd
# (optional - without definition used batman default ff02::2:1001) # (optional - without definition used default ff05::2:1001)
multicast_address = "ff05::2:1001" #multicast_address = "ff02::2:1001"
# define a port to listen # define a port to listen
# if not set or set to 0 the kernel will use a random free port at its own # if not set or set to 0 the kernel will use a random free port at its own
#port = 10001 #port = 10001

View File

@ -52,7 +52,7 @@ synchronize = "1m"
{% method %} {% method %}
How often send request per respondd. How often send request per respondd.
It will send UDP packets with multicast address `ff02::2:1001` and port `1001`. It will send UDP packets with multicast address `ff05::2:1001` and port `1001`.
If a node does not answer after the half time, it will request with the last know address under the port `1001`. If a node does not answer after the half time, it will request with the last know address under the port `1001`.
{% sample lang="toml" %} {% sample lang="toml" %}
```toml ```toml
@ -110,7 +110,7 @@ ifname = "br-ffhb"
{% method %} {% method %}
ip address is the own address which is used for sending. ip address is the own address which is used for sending.
If not set or set with empty string it will take an address of ifname. If not set or set with empty string it will take an address of ifname.
(If `multicast_address` is not set the link local address otherwise a global unicast address) (It preferes the link local address, so at babel mesh-network it should be configurated)
{% sample lang="toml" %} {% sample lang="toml" %}
```toml ```toml
ip_address = "fe80::..." ip_address = "fe80::..."
@ -130,8 +130,8 @@ send_no_request = true
### multicast_address ### multicast_address
{% method %} {% method %}
Multicast address to destination of respondd. Multicast address to destination of respondd.
If not set or set with empty string it will take the batman default multicast address `ff02::2:1001` If not set or set with empty string it will take the batman default multicast address `ff05::2:1001`
(Needed in babel for a mesh-network wide routeable multicast addreess `ff05::2:1001`) (Needed to set for legacy `ff02::2:1001`)
{% sample lang="toml" %} {% sample lang="toml" %}
```toml ```toml
multicast_address = "ff02::2:1001" multicast_address = "ff02::2:1001"

View File

@ -7,7 +7,7 @@ A little overview of yanic in connection with other software:
It sends the `gluon-neighbour-info` request and collects the answers. It sends the `gluon-neighbour-info` request and collects the answers.
It will send UDP packets with multicast address `ff02:0:0:0:0:0:2:1001` and port `1001`. It will send UDP packets with multicast address `ff05:0:0:0:0:0:2:1001` and port `1001`.
If a node does not answer, it will request with the last know address under the port `1001`. If a node does not answer, it will request with the last know address under the port `1001`.

View File

@ -66,7 +66,7 @@ func (coll *Collector) listenUDP(iface InterfaceConfig) {
if iface.IPAddress != "" { if iface.IPAddress != "" {
addr = net.ParseIP(iface.IPAddress) addr = net.ParseIP(iface.IPAddress)
} else { } else {
addr, err = getUnicastAddr(iface.InterfaceName, iface.MulticastAddress == "") addr, err = getUnicastAddr(iface.InterfaceName)
if err != nil { if err != nil {
log.WithField("iface", iface.InterfaceName).Panic(err) log.WithField("iface", iface.InterfaceName).Panic(err)
} }
@ -99,7 +99,7 @@ func (coll *Collector) listenUDP(iface InterfaceConfig) {
} }
// Returns a unicast address of given interface (linklocal or global unicast address) // Returns a unicast address of given interface (linklocal or global unicast address)
func getUnicastAddr(ifname string, linklocal bool) (net.IP, error) { func getUnicastAddr(ifname string) (net.IP, error) {
iface, err := net.InterfaceByName(ifname) iface, err := net.InterfaceByName(ifname)
if err != nil { if err != nil {
return nil, err return nil, err
@ -116,7 +116,7 @@ func getUnicastAddr(ifname string, linklocal bool) (net.IP, error) {
if !ok { if !ok {
continue continue
} }
if (!linklocal && ipnet.IP.IsGlobalUnicast()) || (linklocal && ipnet.IP.IsLinkLocalUnicast()) { if (ip == nil && ipnet.IP.IsGlobalUnicast()) || ipnet.IP.IsLinkLocalUnicast() {
ip = ipnet.IP ip = ipnet.IP
} }
} }

View File

@ -6,7 +6,7 @@ import (
const ( const (
// default multicast group used by announced // default multicast group used by announced
multicastAddressDefault = "ff02:0:0:0:0:0:2:1001" multicastAddressDefault = "ff05:0:0:0:0:0:2:1001"
// default udp port used by announced // default udp port used by announced
port = 1001 port = 1001