diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-06-04 10:01:11 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-06-04 10:01:11 +0300 |
commit | 17214eeed5ad7029ec0f437f6952e981fe67e1a6 (patch) | |
tree | f644aaa6e268ddb9b6f4f99e52f25aedb0c7c3e1 /mtu.c | |
parent | 3adee5dcb970c88d6eac6de72e5fc19965f341d9 (diff) | |
download | pingu-17214eeed5ad7029ec0f437f6952e981fe67e1a6.tar.bz2 pingu-17214eeed5ad7029ec0f437f6952e981fe67e1a6.tar.xz |
mtu: just ignore uninteresting icmp replies
... we probably get the interesting one later. This is in case
there's lot of icmp errors, we otherwise get tricked by those.
Diffstat (limited to 'mtu.c')
-rw-r--r-- | mtu.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -42,6 +42,7 @@ static int do_ping(int seq, int size) icmp_send_ping(fd, (struct sockaddr *) &to, sizeof(to), seq, size); +not_mine: if ((len = icmp_read_reply(fd, (struct sockaddr *) &from, sizeof(from), buf, sizeof(buf))) <= 0) continue; @@ -49,7 +50,7 @@ static int do_ping(int seq, int size) if (icmp_parse_reply(buf, len, seq, (struct sockaddr *) &from, (struct sockaddr *) &to)) - return -1; + goto not_mine; icp = (struct icmphdr *) &buf[ip->ihl * 4]; switch (icp->type) { |