After upgrading from kernel 6.0.7 to 6.1.6 on Arch Linux, unprivileged ICMP traceroute using the traceroute -I tool stopped working – it very reliably fails with a "No route to host" at some point, while the same traceroute still works for root (or in UDP mode):
$ traceroute -I 83.171.33.188
traceroute to 83.171.33.188 (83.171.33.188), 30 hops max, 60
byte packets
1 _gateway (192.168.1.1) 0.819 ms
send: No route to host
[exited with 1]
strace log can be found at: https://lore.kernel.org/netdev/168aa9cf-d80a-9c1b-887f-97015a0473dc@gmail.com/
Although this only broke with kernel 6.1, the kernel developers suggest that the kernel change is correct and just exposed a traceroute bug: https://lore.kernel.org/netdev/CANn89iLKQB=9rYyKXVH=hd2aBUjzhhjXA0FOdSvN3reH+k9cMQ@mail.gmail.com/
Eric Dumazet suggests the following patch, which indeed seems to work and makes unprivileged ICMP mode work again:
diff traceroute/traceroute.c.orig traceroute/traceroute.c
1657c1657
< if (errno == EMSGSIZE)
---
> if (errno == EMSGSIZE || errno == EHOSTUNREACH)
Thenks for fix and report.
Confirmed with kernel-6.2.0 on Fedora Rawhide.
Fixed in traceroute-2.1.2