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
|
@ -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…
Add table
Add a link
Reference in a new issue