Files
freebsd-src/usr.sbin
Eugene Grosbein 60a6ebaf73 traceroute: graceful recover after networking errors with as_server
Currentlu, the traceroute[6] utility does not check
for possible networking errors while talking to as_server
in case of "traceroute -a". Meantime, there is a common case
when trace is long and it has many non-responding hops
(shown as '* * *'), so as_server aborts our connection,
hence no AS numbers shown for the rest of trace.

Somewhat artifical way to reproduce the problem:

traceroute to 57.144.244.1 (57.144.244.1), 80 hops max, 48 byte packets
 5  [AS174] be2950.ccr42.fra05.atlas.cogentco.com (154.54.72.42)  74.277 ms  9.605 ms  9.599 ms
 6  [AS174] 149.11.228.19 (149.11.228.19)  9.506 ms  9.466 ms  9.420 ms
 7  [AS33182] po172.asw02.fra5.tfbnw.net (129.134.108.146)  9.725 ms  9.874 ms  9.696 ms
 8  [AS32934] psw04.fra5.tfbnw.net (157.240.59.85)  8.718 ms  8.691 ms  8.618 ms
 9  * * *
10  [AS0] edge-star-mini-shv-01-fra5.facebook.com (57.144.244.1)  9.747 ms  9.815 ms  9.699 ms

Note what due to increased timeout (-w10) we get [AS0] for 10th hop
because as_server closed our connection. Same problem occurs
with default -w3 when there are lots of '* * *' hops in a trace.

Fix it with some additional error checking and a reconnection.

This patch was in my use for many years and after traceroute(8) moved
from contrib/ to usr.sbin/ it's nice to have it in the tree.

MFC after:	2 weeks
2026-02-09 17:00:10 +07:00
..
2025-11-12 21:38:35 -05:00
2024-10-14 10:26:17 -07:00
2025-08-12 14:35:35 -06:00
2024-10-14 10:26:17 -07:00
2025-11-26 23:19:26 -07:00
2024-11-03 15:18:39 -05:00
2025-11-12 12:09:09 -05:00
2025-07-22 16:06:31 -04:00
2024-10-14 10:26:17 -07:00
2025-11-24 10:47:10 -05:00
2025-12-20 19:49:51 +01:00
2024-11-04 11:26:14 -04:00
2026-01-05 11:04:46 -05:00
2026-01-06 12:56:50 -05:00
2025-11-19 15:30:02 +01:00
2025-11-06 13:56:36 +01:00
2024-09-21 05:25:15 -06:00
2024-01-24 17:10:24 -05:00
2025-09-20 14:31:44 +02:00
2025-09-29 22:53:34 +01:00
2025-09-10 12:00:05 +08:00
2025-10-28 15:01:38 -04:00
2024-10-14 10:26:17 -07:00
2024-10-14 10:26:17 -07:00
2024-10-14 10:26:17 -07:00
2025-05-21 12:37:10 -04:00
2024-11-04 08:57:13 -05:00
2025-10-08 12:49:45 +00:00
2025-11-14 15:29:05 +01:00
2025-05-05 16:39:25 +01:00
2025-08-07 03:23:19 +02:00
2025-11-18 16:24:20 +00:00
2026-01-12 14:32:32 +01:00
2025-03-31 16:55:39 +02:00
2025-12-09 21:57:10 +07:00
2025-08-06 11:18:59 -04:00
2025-03-29 17:48:06 -03:00
2025-11-08 08:04:33 +00:00
2024-10-14 10:26:17 -07:00
2025-08-22 16:13:15 -04:00
2026-01-09 11:28:43 -05:00