]> git.ipfire.org Git - thirdparty/mtr.git/commit
mtr-packet: make address-not-available errors less likely 306/head
authorSami Kerola <kerolasa@iki.fi>
Wed, 17 Jul 2019 19:17:56 +0000 (20:17 +0100)
committerSami Kerola <kerolasa@iki.fi>
Wed, 17 Jul 2019 19:17:56 +0000 (20:17 +0100)
commit0934883fe1455e9e63ad978451bbeba3d37cf9b1
tree52ba9770f11c39a8fb615790de9d4113545326b6
parent60e5c5c8c6a55e911f9598441764ae3e7c337dc2
mtr-packet: make address-not-available errors less likely

Use MIN_PORT to MAX_PORT port range to avoid getting EADDRNOTAVAIL caused by
sockets in FIN-WAIT-1 state.  This issue is easy to reproduce with following
loop (as root).

    src="$(ip route | awk '/default/ {print $9}')"
    while true; do
      echo "6000 send-probe ip-4 1.1.1.1 local-ip-4 $src port 443 protocol tcp" |
      ./mtr-packet
    done | head -n 10
    6000 reply ip-4 1.1.1.1 round-trip-time 11306
    6000 address-not-available
    6000 address-not-available
    [...]

Reported-by: Scott Pearson <scott@cloudflare.com>
Reproeuced-by: Jarred Trainor <jarred@cloudflare.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi> && <kerolasa@cloudflare.com>
packet/probe_unix.c