Move responsibility for local discovery to UDP discovery.
Since UDP discovery is the place where UDP feasibility is checked, it makes sense to test for local connectivity as well. This was previously done as part of PMTU discovery.
This commit is contained in:
parent
7939ee1283
commit
88026f2771
3 changed files with 9 additions and 11 deletions
|
@ -358,7 +358,7 @@ This will allow direct communication using LAN addresses, even if both peers are
|
|||
and they only ConnectTo a third node outside the NAT,
|
||||
which normally would prevent the peers from learning each other's LAN address.
|
||||
.Pp
|
||||
Currently, local discovery is implemented by sending some packets to the local address of the node during path MTU discovery. This will not work with old nodes that don't transmit their local address.
|
||||
Currently, local discovery is implemented by sending some packets to the local address of the node during UDP discovery. This will not work with old nodes that don't transmit their local address.
|
||||
.It Va MACExpire Li = Ar seconds Pq 600
|
||||
This option controls the amount of time MAC addresses are kept before they are removed.
|
||||
This only has effect when
|
||||
|
|
|
@ -1081,8 +1081,8 @@ This will allow direct communication using LAN addresses, even if both peers are
|
|||
and they only ConnectTo a third node outside the NAT,
|
||||
which normally would prevent the peers from learning each other's LAN address.
|
||||
|
||||
Currently, local discovery is implemented by sending broadcast packets to the LAN during path MTU discovery.
|
||||
This feature may not work in all possible situations.
|
||||
Currently, local discovery is implemented by sending some packets to the local address of the node during UDP discovery.
|
||||
This will not work with old nodes that don't transmit their local address.
|
||||
|
||||
@cindex LocalDiscoveryAddress
|
||||
@item LocalDiscoveryAddress <@var{address}>
|
||||
|
|
|
@ -146,14 +146,6 @@ static void send_mtu_probe_handler(void *data) {
|
|||
send_udp_probe_packet(n, MAX(len, 64));
|
||||
}
|
||||
|
||||
/* In case local discovery is enabled, another packet is added to each batch,
|
||||
which will be broadcast to the local network. */
|
||||
if(localdiscovery && n->mtuprobes <= 10 && n->prevedge) {
|
||||
n->status.send_locally = true;
|
||||
send_udp_probe_packet(n, 16);
|
||||
n->status.send_locally = false;
|
||||
}
|
||||
|
||||
n->probe_counter = 0;
|
||||
gettimeofday(&n->probe_time, NULL);
|
||||
|
||||
|
@ -969,6 +961,12 @@ static void try_udp(node_t* n) {
|
|||
if(ping_tx_elapsed.tv_sec >= udp_discovery_interval) {
|
||||
send_udp_probe_packet(n, MAX(n->minmtu, 16));
|
||||
n->udp_ping_sent = now;
|
||||
|
||||
if(localdiscovery && !n->status.udp_confirmed && n->prevedge) {
|
||||
n->status.send_locally = true;
|
||||
send_udp_probe_packet(n, 16);
|
||||
n->status.send_locally = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue