Skip to content

Commit bad641b

Browse files
John Heffneryoshfuji
John Heffner
authored andcommitted
[iputils] tracepath: Re-probe at same TTL after MTU reduction.
This fixes a bug that would miss a hop after an ICMP packet too big message, since it would continue increase the TTL without probing again. Signed-off-by: YOSHIFUJI Hideaki <[email protected]>
1 parent 006fd80 commit bad641b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tracepath.c

+6
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,14 @@ main(int argc, char **argv)
352352
exit(1);
353353
}
354354

355+
restart:
355356
for (i=0; i<3; i++) {
357+
int old_mtu;
358+
359+
old_mtu = mtu;
356360
res = probe_ttl(fd, ttl);
361+
if (mtu != old_mtu)
362+
goto restart;
357363
if (res == 0)
358364
goto done;
359365
if (res > 0)

tracepath6.c

+6
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,14 @@ int main(int argc, char **argv)
422422
exit(1);
423423
}
424424

425+
restart:
425426
for (i=0; i<3; i++) {
427+
int old_mtu;
428+
429+
old_mtu = mtu;
426430
res = probe_ttl(fd, ttl);
431+
if (mtu != old_mtu)
432+
goto restart;
427433
if (res == 0)
428434
goto done;
429435
if (res > 0)

0 commit comments

Comments
 (0)