Remove broadcast-based local discovery mechanism.
The new local address based local discovery mechanism is technically superior to the old broadcast-based one. In fact, the old algorithm can technically make things worse by e.g. sending broadcasts over the VPN itself and then selecting the VPN address as the node's UDP address. This cannot happen with the new mechanism. Note that this means old nodes that don't send their local addresses in ADD_EDGE messages can't be discovered, because there is no address to send discovery packets to. Old nodes can still discover new nodes by sending them broadcasts, though.
This commit is contained in:
parent
e16ade874d
commit
4159108971
4 changed files with 5 additions and 58 deletions
|
|
@ -532,16 +532,6 @@ bool setup_myself_reloadable(void) {
|
|||
get_config_bool(lookup_config(config_tree, "DirectOnly"), &directonly);
|
||||
get_config_bool(lookup_config(config_tree, "LocalDiscovery"), &localdiscovery);
|
||||
|
||||
memset(&localdiscovery_address, 0, sizeof localdiscovery_address);
|
||||
if(get_config_string(lookup_config(config_tree, "LocalDiscoveryAddress"), &address)) {
|
||||
struct addrinfo *ai = str2addrinfo(address, myport, SOCK_DGRAM);
|
||||
free(address);
|
||||
if(!ai)
|
||||
return false;
|
||||
memcpy(&localdiscovery_address, ai->ai_addr, ai->ai_addrlen);
|
||||
}
|
||||
|
||||
|
||||
if(get_config_string(lookup_config(config_tree, "Mode"), &rmode)) {
|
||||
if(!strcasecmp(rmode, "router"))
|
||||
routing_mode = RMODE_ROUTER;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue