]> The Tcpdump Group git mirrors - tcpdump/commitdiff
IGMPv3's Max Response Time is in units of 0.1 second.
authorBill Fenner <[email protected]>
Mon, 13 Feb 2012 16:27:08 +0000 (08:27 -0800)
committerBill Fenner <[email protected]>
Mon, 13 Feb 2012 16:27:08 +0000 (08:27 -0800)
If it's less than 60 seconds, print it as %.1fs, to be able to
accurately represent small values including the tenths-of-a-second.
Only use relts_print() when it is 60 seconds or more.

print-igmp.c

index 6522bc3044d04ae881d72020e6823f802190fa90..a0c8d6fec4489af7270402ee0b4ad43267b56dc5 100644 (file)
@@ -227,7 +227,11 @@ print_igmpv3_query(register const u_char *bp, register u_int len)
     }
     if (mrc != 100) {
        (void)printf(" [max resp time ");
-       relts_print(mrt);
+        if (mrt < 60) {
+            (void)printf("%.1fs", mrt * 0.1);
+        } else {
+            relts_print(mrt / 10);
+        }
        (void)printf("]");
     }
     TCHECK2(bp[4], 4);