- timeout = pinginterval;
- goto end;
- } else if(n->mtuprobes == 32) {
- timeout = pingtimeout;
- }
-
- /* After the initial discovery, a fourth packet is added to each batch with a
- size larger than the currently known PMTU, to test if the PMTU has increased. */
- if (n->mtuprobes >= 30 && n->maxmtu + 8 < MTU)
- send_mtu_probe_packet(n, n->maxmtu + 8);
-
- /* Probes are sent in batches of three, with random sizes between the
- lower and upper boundaries for the MTU thus far discovered. */
- for (int i = 0; i < 3; i++) {
- int len = n->maxmtu;
- if(n->minmtu < n->maxmtu)
- len = n->minmtu + 1 + rand() % (n->maxmtu - n->minmtu);
-
- send_mtu_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_mtu_probe_packet(n, 16);
- n->status.send_locally = false;
+ /* After the initial discovery, we only send one >maxmtu probe
+ to detect PMTU increases. */
+ if(n->maxmtu + 8 < MTU)
+ send_udp_probe_packet(n, n->maxmtu + 8);
+ } else {
+ /* Probes are sent in batches of three, with random sizes between the
+ lower and upper boundaries for the MTU thus far discovered. */
+ for (int i = 0; i < 3; i++) {
+ int len = n->maxmtu;
+ if(n->minmtu < n->maxmtu)
+ len = n->minmtu + 1 + rand() % (n->maxmtu - n->minmtu);
+
+ send_udp_probe_packet(n, MAX(len, 64));
+ }
+ n->mtuprobes++;