aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-06-04 10:01:11 +0300
committerTimo Teräs <timo.teras@iki.fi>2012-06-04 10:01:11 +0300
commit17214eeed5ad7029ec0f437f6952e981fe67e1a6 (patch)
treef644aaa6e268ddb9b6f4f99e52f25aedb0c7c3e1
parent3adee5dcb970c88d6eac6de72e5fc19965f341d9 (diff)
downloadpingu-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.
-rw-r--r--mtu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mtu.c b/mtu.c
index cc75e1e..77766eb 100644
--- a/mtu.c
+++ b/mtu.c
@@ -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) {