]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-vrrp.c
change make check to work with POSIX shell
[tcpdump] / print-vrrp.c
index a6e231434acf9c52474b8a067ffce69824e82604..a39766767e40d7a054cae8f3d2c96789172ed317 100644 (file)
@@ -23,6 +23,8 @@
  * FOR A PARTICULAR PURPOSE.
  */
 
+/* \summary: Virtual Router Redundancy Protocol (VRRP) printer */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -140,17 +142,21 @@ vrrp_print(netdissect_options *ndo,
 
                        vec[0].ptr = bp;
                        vec[0].len = len;
-                       if (in_cksum(vec, 1))
+                       if (in_cksum(vec, 1)) {
+                               ND_TCHECK_16BITS(&bp[6]);
                                ND_PRINT((ndo, ", (bad vrrp cksum %x)",
                                        EXTRACT_16BITS(&bp[6])));
+                       }
                }
 
                if (version == 3 && ND_TTEST2(bp[0], len)) {
                        uint16_t cksum = nextproto4_cksum(ndo, (const struct ip *)bp2, bp,
                                len, len, IPPROTO_VRRP);
-                       if (cksum)
+                       if (cksum) {
+                               ND_TCHECK_16BITS(&bp[6]);
                                ND_PRINT((ndo, ", (bad vrrp cksum %x)",
                                        EXTRACT_16BITS(&bp[6])));
+                       }
                }
 
                ND_PRINT((ndo, ", addrs"));