Before this change the report gave successful exit value when destination
hostname could not be found.
$ ./mtr --report nxdomain. ; echo $?
./mtr: Failed to resolve host: nxdomain.: Name or service not known
0
Quickly looking 'git grep ---after-context if.*Interactive' there does not
appear to be more than the two instances in main() where exit is called
depending on interactive, so this change should cover all these cases.
Reported-by: Marek Kroemeke <mkroemeke@cloudflare.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
It is not unknown to have datacenters with over 8 ECMP paths between two
hops. Expand the maximum number of ECMP hosts stored in addrs to 128,
and add a new option to control the number to display, defaulting to the
old MAX_PATHS of 8
Change d2552ca has the side effect of moving hosts around in the
multipath view, as the last host to reply to a packet was set as
addr. Using addrs[0] istead of addr to draw the first host keeps
the ordering deterministic, in order of first reply.
Port 33434 is the IANA-reserved port for traceroute. It also seems to be
the most common start port. The following implementations, and
likely others, use it as their start port:
- Apple macOS traceroute
- FreeBSD traceroute
- GNU inetutils-traceroute
- Modern traceroute for Linux
- OpenBSD traceroute
The benefit to using a standard starting port is that some firewalls may
have these ports allowed, whereas other ports may be blocked, so there
is a greater probability the probe will succeed.
this fixes a problem where both source and destination port are supplied on the commandline,
this lead to packets not showing up any more due to checksum being different.
this was mentioned first on https://github.com/traviscross/mtr/issues/351
`ncuses-6.3` added printf-style function attributes and now makes
it easier to catch cases when user input is used in palce of format
string when built with CFLAGS=-Werror=format-security:
ui/curses.c:765:42:
error: format not a string literal and no format arguments [-Werror=format-security]
765 | mvprintw(rowstat - 1, startstat, msg);
| ^~~
Let's wrap all the missing places with "%s" format.