]> git.ipfire.org Git - thirdparty/mtr.git/commit
net: implement addrcmp for AF_UNSPEC 534/head
authorJames Lu <james@overdrivenetworks.com>
Sat, 14 Jun 2025 02:06:21 +0000 (19:06 -0700)
committerJames Lu <james@overdrivenetworks.com>
Sat, 14 Jun 2025 02:24:10 +0000 (19:24 -0700)
commit24f73e7aff930038dfbc204df8ba3d119f8528fa
tree84854129b363696b5d406fc93c31356bb215a189
parent0a9c1d466ac89305c3b8fb6bd7b90162182fadcf
net: implement addrcmp for AF_UNSPEC

When mtr is compiled with IPv6 enabled, the GTK frontend sets the address family to AF_UNSPEC when changing destinations. However, addrcomp does not support this AF type, which causes all comparisons to not match. For the GTK frontend, this leads to a cascading failure when setting the destination to a host that does not resolve:

1. Upon setting ctl->af = AF_UNSPEC, net_max() will report that all hops have data, as no hops can match the previous remote address.
2. The GTK frontend tries to render a row for every hop, including its IP / hostname.
3. The guard in the GTK frontend to avoid looking up unknown addresses also fails, causing mtr to flood DNS packets and effectively hang.

Fixes https://github.com/traviscross/mtr/issues/533
ui/net.c