Subject: bug#774: traceroute: Exit code is not reliable nor documented

From: Alessandro Vesely <[email-masked]>
Date: Fri, 18 Aug 2023 10:08:31 +0200

Package: traceroute
Version: 1:2.1.0-2+deb11u1
Severity: grave
Justification: renders package unusable

Dear Maintainer,

I've been using traceroute to monitor network state of the server.
It is called for each interface by a cron job running a few times per hour.
Since yesterday, an interface stopped working, but the job never noticed it.
Manually calling traceroute only shows the (natted) modem interface:

:~# ip addr show eth1r
3: eth1r: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:26:55:e0:d0:e8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.254/24 brd 192.168.1.255 scope global eth1r
       valid_lft forever preferred_lft forever
    inet6 fe80::226:55ff:fee0:d0e8/64 scope link 
       valid_lft forever preferred_lft forever

:~# traceroute -4 -n -i eth1r -m 4 -s 192.168.1.254 185.204.135.186
traceroute to 185.204.135.186 (185.204.135.186), 4 hops max, 60 byte packets
 1  192.168.1.1  0.235 ms  0.282 ms  0.289 ms
 2  * * *
 3  * * *
 4  * * *

Exit code is 0.  In fact recvmsg reports no error.  The relevant calls are:
23495 sendto(14, "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_", 32, 0, NULL, 0) = 32
23495 +++ exited with 0 +++

The modem obviously needs a reset.  The point is that I was expecting
traceroute to detect that, since the interface doesn't work.  If this
is not a bug in the code, it is in the documentation, tagged 11 October
2006, which doesn't mention exit code at all.

Thanks
Ale

-- System Information:
Distributor ID:	Devuan
Description:	Devuan GNU/Linux 4 (chimaera)
Release:	4
Codename:	chimaera
Architecture: x86_64

Kernel: Linux 5.10.0-24-amd64 (SMP w/8 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/bash
Init: sysvinit (via /sbin/init)

Versions of packages traceroute depends on:
ii  libc6  2.31-13+deb11u6

traceroute recommends no packages.

traceroute suggests no packages.

-- no debconf information