Skip to content

Commit

Permalink
[TASK] change default listing address to ff05::2:1001
Browse files Browse the repository at this point in the history
  • Loading branch information
genofire committed May 3, 2019
1 parent 99443cb commit 3126785
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Yet another node info collector

## 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.

## Documentation
Expand Down
6 changes: 3 additions & 3 deletions config_example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ domains = ["city"]
# name of interface on which this collector is running
ifname = "br-ffhb"
# 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"
# disable sending multicast respondd request
# (for receiving only respondd packages e.g. database respondd)
#send_no_request = false
# multicast address to destination of respondd
# (optional - without definition used batman default ff02::2:1001)
multicast_address = "ff05::2:1001"
# (optional - without definition used default ff05::2:1001)
#multicast_address = "ff02::2:1001"
# define a port to listen
# if not set or set to 0 the kernel will use a random free port at its own
#port = 10001
Expand Down
8 changes: 4 additions & 4 deletions docs/docs_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ synchronize = "1m"
{% method %}
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`.
{% sample lang="toml" %}
```toml
Expand Down Expand Up @@ -110,7 +110,7 @@ ifname = "br-ffhb"
{% method %}
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 `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" %}
```toml
ip_address = "fe80::..."
Expand All @@ -130,8 +130,8 @@ send_no_request = true
### multicast_address
{% method %}
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`
(Needed in babel for a mesh-network wide routeable multicast addreess `ff05::2:1001`)
If not set or set with empty string it will take the batman default multicast address `ff05::2:1001`
(Needed to set for legacy `ff02::2:1001`)
{% sample lang="toml" %}
```toml
multicast_address = "ff02::2:1001"
Expand Down
2 changes: 1 addition & 1 deletion docs/home_about.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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`.

Expand Down
6 changes: 3 additions & 3 deletions respond/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (coll *Collector) listenUDP(iface InterfaceConfig) {
if iface.IPAddress != "" {
addr = net.ParseIP(iface.IPAddress)
} else {
addr, err = getUnicastAddr(iface.InterfaceName, iface.MulticastAddress == "")
addr, err = getUnicastAddr(iface.InterfaceName)
if err != nil {
log.WithField("iface", iface.InterfaceName).Panic(err)
}
Expand Down Expand Up @@ -99,7 +99,7 @@ func (coll *Collector) listenUDP(iface InterfaceConfig) {
}

// 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)
if err != nil {
return nil, err
Expand All @@ -116,7 +116,7 @@ func getUnicastAddr(ifname string, linklocal bool) (net.IP, error) {
if !ok {
continue
}
if (!linklocal && ipnet.IP.IsGlobalUnicast()) || (linklocal && ipnet.IP.IsLinkLocalUnicast()) {
if (ip == nil && ipnet.IP.IsGlobalUnicast()) || ipnet.IP.IsLinkLocalUnicast() {
ip = ipnet.IP
}
}
Expand Down
2 changes: 1 addition & 1 deletion respond/respond.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

const (
// 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
port = 1001
Expand Down

0 comments on commit 3126785

Please sign in to comment.