The following commit has been merged in the next branch: commit 2ecb2c8b060b63f801d9070633806a0ba5e6ff3f Author: Marek Lindner lindner_marek@yahoo.de Date: Mon Feb 6 22:04:17 2012 +0800
batctl: tr / ping - ignore packets with wrong sequence number
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
diff --git a/ping.c b/ping.c index dff0f33..791cfb7 100644 --- a/ping.c +++ b/ping.c @@ -196,6 +196,7 @@ int ping(char *mesh_iface, int argc, char **argv) goto sleep; }
+read_packet: start_timer();
FD_ZERO(&read_socket); @@ -229,6 +230,10 @@ int ping(char *mesh_iface, int argc, char **argv) goto sleep; }
+ /* after receiving an unexpected seqno we keep waiting for our answer */ + if (htons(seq_counter) != icmp_packet_in.seqno) + goto read_packet; + switch (icmp_packet_in.msg_type) { case ECHO_REPLY: time_delta = end_timer(); diff --git a/traceroute.c b/traceroute.c index f9e62cd..fdc9e4a 100644 --- a/traceroute.c +++ b/traceroute.c @@ -142,6 +142,7 @@ int traceroute(char *mesh_iface, int argc, char **argv) continue; }
+read_packet: start_timer();
tv.tv_sec = 2; @@ -168,6 +169,10 @@ int traceroute(char *mesh_iface, int argc, char **argv) continue; }
+ /* after receiving an unexpected seqno we keep waiting for our answer */ + if (htons(seq_counter) != icmp_packet_in.seqno) + goto read_packet; + switch (icmp_packet_in.msg_type) { case ECHO_REPLY: dst_reached = 1;