]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use pointer expressions like in most similar cases
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 20 Nov 2017 21:58:59 +0000 (22:58 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 20 Nov 2017 21:58:59 +0000 (22:58 +0100)
18 files changed:
print-atm.c
print-bgp.c
print-carp.c
print-cdp.c
print-chdlc.c
print-dhcp6.c
print-icmp6.c
print-igmp.c
print-ip.c
print-ip6opts.c
print-ipx.c
print-isakmp.c
print-mobility.c
print-nfs.c
print-pim.c
print-smb.c
print-sunatm.c
print-vrrp.c

index b303318220d64ec8879c1b378e1ede2f6ef71057..c8a16ba6dc4a7c702e500174cb7815d432bc113b 100644 (file)
@@ -366,7 +366,7 @@ sig_print(netdissect_options *ndo,
                 * do from the caplen test above, we also know we have
                 * the call reference.
                 */
-               call_ref = EXTRACT_BE_24BITS(&p[CALL_REF_POS]);
+               call_ref = EXTRACT_BE_24BITS(p + CALL_REF_POS);
                ND_PRINT((ndo, "CALL_REF:0x%06x", call_ref));
        } else {
                /* SSCOP with some unknown protocol atop it */
index 0c7e18b0fc24d9c2b5554a65e75bab9b1f1e5719..b78f7c91bb3315b1a1a6292ec036e9442c8b7ddf 100644 (file)
@@ -1435,8 +1435,8 @@ bgp_attr_print(netdissect_options *ndo,
                            ND_PRINT((ndo, "%s ",
                                as_printf(ndo, astostr, sizeof(astostr),
                                as_size == 2 ?
-                               EXTRACT_BE_16BITS(&tptr[2 + i]) :
-                               EXTRACT_BE_32BITS(&tptr[2 + i]))));
+                               EXTRACT_BE_16BITS(tptr + i + 2) :
+                               EXTRACT_BE_32BITS(tptr + i + 2))));
                         }
                        ND_TCHECK(tptr[0]);
                         ND_PRINT((ndo, "%s", tok2str(bgp_as_path_segment_close_values,
index 918617bd417a9da2f19040d744a6f7d55ec5b1e5..ceed9b0dd850dcfec55ba7f107827e2ad513ae59 100644 (file)
@@ -73,9 +73,9 @@ carp_print(netdissect_options *ndo, register const u_char *bp, register u_int le
                vec[0].len = len;
                if (ND_TTEST2(bp[0], len) && in_cksum(vec, 1))
                        ND_PRINT((ndo, " (bad carp cksum %x!)",
-                               EXTRACT_BE_16BITS(&bp[6])));
+                               EXTRACT_BE_16BITS(bp + 6)));
        }
-       ND_PRINT((ndo, "counter=%" PRIu64, EXTRACT_BE_64BITS(&bp[8])));
+       ND_PRINT((ndo, "counter=%" PRIu64, EXTRACT_BE_64BITS(bp + 8)));
 
        return;
 trunc:
index d8d654ae852057bc0674d9bb03e4cbc16859d4de..6913e3c2226280fa14a4492923d2fe616539aa4d 100644 (file)
@@ -302,7 +302,7 @@ cdp_print_addr(netdissect_options *ndo,
                ND_TCHECK2(p[pl], 2);
                if (p + pl + 2 > endp)
                        goto trunc;
-               al = EXTRACT_BE_16BITS(&p[pl]); /* address length */
+               al = EXTRACT_BE_16BITS(p + pl); /* address length */
 
                if (pt == PT_NLPID && pl == 1 && *p == NLPID_IP && al == 4) {
                        /*
index b46828f94d00fa66a331bca94c64c56548c1f3a1..e988ed1ef77dab6edac587f5cf56de7b3e533003 100644 (file)
@@ -59,7 +59,7 @@ chdlc_print(netdissect_options *ndo, register const u_char *p, u_int length)
        if (length < CHDLC_HDRLEN)
                goto trunc;
        ND_TCHECK2(*p, CHDLC_HDRLEN);
-       proto = EXTRACT_BE_16BITS(&p[2]);
+       proto = EXTRACT_BE_16BITS(p + 2);
        if (ndo->ndo_eflag) {
                 ND_PRINT((ndo, "%s, ethertype %s (0x%04x), length %u: ",
                        tok2str(chdlc_cast_values, "0x%02x", p[0]),
index 2b16bc0037899c8454a9205a95f5f7687b45bb9c..804494971bc82003591713f12eae779633b8169c 100644 (file)
@@ -322,8 +322,8 @@ dhcp6opt_print(netdissect_options *ndo,
                        case 1:
                                if (optlen >= 2 + 6) {
                                        ND_PRINT((ndo, " hwaddr/time type %u time %u ",
-                                           EXTRACT_BE_16BITS(&tp[2]),
-                                           EXTRACT_BE_32BITS(&tp[4])));
+                                           EXTRACT_BE_16BITS(tp + 2),
+                                           EXTRACT_BE_32BITS(tp + 4)));
                                        for (i = 8; i < optlen; i++)
                                                ND_PRINT((ndo, "%02x", tp[i]));
                                        /*(*/
@@ -348,7 +348,7 @@ dhcp6opt_print(netdissect_options *ndo,
                        case 3:
                                if (optlen >= 2 + 2) {
                                        ND_PRINT((ndo, " hwaddr type %u ",
-                                           EXTRACT_BE_16BITS(&tp[2])));
+                                           EXTRACT_BE_16BITS(tp + 2)));
                                        for (i = 4; i < optlen; i++)
                                                ND_PRINT((ndo, "%02x", tp[i]));
                                        /*(*/
@@ -372,8 +372,8 @@ dhcp6opt_print(netdissect_options *ndo,
                        tp = (const u_char *)(dh6o + 1);
                        ND_PRINT((ndo, " %s", ip6addr_string(ndo, &tp[0])));
                        ND_PRINT((ndo, " pltime:%u vltime:%u",
-                           EXTRACT_BE_32BITS(&tp[16]),
-                           EXTRACT_BE_32BITS(&tp[20])));
+                           EXTRACT_BE_32BITS(tp + 16),
+                           EXTRACT_BE_32BITS(tp + 20)));
                        if (optlen > 24) {
                                /* there are sub-options */
                                dhcp6opt_print(ndo, tp + 24, tp + optlen);
@@ -389,7 +389,7 @@ dhcp6opt_print(netdissect_options *ndo,
                        tp = (const u_char *)(dh6o + 1);
                        for (i = 0; i < optlen; i += 2) {
                                ND_PRINT((ndo, " %s",
-                                   tok2str(dh6opt_str, "opt_%u", EXTRACT_BE_16BITS(&tp[i]))));
+                                   tok2str(dh6opt_str, "opt_%u", EXTRACT_BE_16BITS(tp + i))));
                        }
                        ND_PRINT((ndo, ")"));
                        break;
@@ -579,7 +579,7 @@ dhcp6opt_print(netdissect_options *ndo,
                                break;
                        }
                        tp = (const u_char *)(dh6o + 1);
-                       ND_PRINT((ndo, " %s)", dhcp6stcode(EXTRACT_BE_16BITS(&tp[0]))));
+                       ND_PRINT((ndo, " %s)", dhcp6stcode(EXTRACT_BE_16BITS(tp))));
                        break;
                case DH6OPT_IA_NA:
                case DH6OPT_IA_PD:
@@ -589,9 +589,9 @@ dhcp6opt_print(netdissect_options *ndo,
                        }
                        tp = (const u_char *)(dh6o + 1);
                        ND_PRINT((ndo, " IAID:%u T1:%u T2:%u",
-                           EXTRACT_BE_32BITS(&tp[0]),
-                           EXTRACT_BE_32BITS(&tp[4]),
-                           EXTRACT_BE_32BITS(&tp[8])));
+                           EXTRACT_BE_32BITS(tp),
+                           EXTRACT_BE_32BITS(tp + 4),
+                           EXTRACT_BE_32BITS(tp + 8)));
                        if (optlen > 12) {
                                /* there are sub-options */
                                dhcp6opt_print(ndo, tp + 12, tp + optlen);
@@ -619,8 +619,8 @@ dhcp6opt_print(netdissect_options *ndo,
                        tp = (const u_char *)(dh6o + 1);
                        ND_PRINT((ndo, " %s/%d", ip6addr_string(ndo, &tp[9]), tp[8]));
                        ND_PRINT((ndo, " pltime:%u vltime:%u",
-                           EXTRACT_BE_32BITS(&tp[0]),
-                           EXTRACT_BE_32BITS(&tp[4])));
+                           EXTRACT_BE_32BITS(tp),
+                           EXTRACT_BE_32BITS(tp + 4)));
                        if (optlen > 25) {
                                /* there are sub-options */
                                dhcp6opt_print(ndo, tp + 25, tp + optlen);
index 5157700ee319d2b68fe9c0e3c127861c932082bb..aab19971279067475e21c8468e3d6d81fea60020 100644 (file)
@@ -1505,7 +1505,7 @@ mldv2_query_print(netdissect_options *ndo, const u_char *bp, u_int len)
     }
 
     ND_TCHECK2(bp[26], 2);
-    nsrcs = EXTRACT_BE_16BITS(&bp[26]);
+    nsrcs = EXTRACT_BE_16BITS(bp + 26);
     if (nsrcs > 0) {
        if (len < 28 + nsrcs * sizeof(struct in6_addr))
            ND_PRINT((ndo," [invalid number of sources]"));
index fc0ef6834991da8c0c9046698e529b24256bd224..635c1c53e163ae391cd973cda75acf35add1a043 100644 (file)
@@ -159,7 +159,7 @@ print_igmpv3_report(netdissect_options *ndo,
        return;
     }
     ND_TCHECK2(bp[6], 2);
-    ngroups = EXTRACT_BE_16BITS(&bp[6]);
+    ngroups = EXTRACT_BE_16BITS(bp + 6);
     ND_PRINT((ndo, ", %d group record(s)", ngroups));
     if (ndo->ndo_vflag > 0) {
        /* Print the group records */
@@ -173,7 +173,7 @@ print_igmpv3_report(netdissect_options *ndo,
             ND_PRINT((ndo, " [gaddr %s", ipaddr_string(ndo, &bp[group+4])));
            ND_PRINT((ndo, " %s", tok2str(igmpv3report2str, " [v3-report-#%d]",
                                                                bp[group])));
-            nsrcs = EXTRACT_BE_16BITS(&bp[group + 2]);
+            nsrcs = EXTRACT_BE_16BITS(bp + group + 2);
            /* Check the number of sources and print them */
            if (len < group+8+(nsrcs<<2)) {
                ND_PRINT((ndo, " [invalid number of sources %d]", nsrcs));
@@ -232,11 +232,11 @@ print_igmpv3_query(netdissect_options *ndo,
        ND_PRINT((ndo, "]"));
     }
     ND_TCHECK2(bp[4], 4);
-    if (EXTRACT_BE_32BITS(&bp[4]) == 0)
+    if (EXTRACT_BE_32BITS(bp + 4) == 0)
        return;
     ND_PRINT((ndo, " [gaddr %s", ipaddr_string(ndo, &bp[4])));
     ND_TCHECK2(bp[10], 2);
-    nsrcs = EXTRACT_BE_16BITS(&bp[10]);
+    nsrcs = EXTRACT_BE_16BITS(bp + 10);
     if (nsrcs > 0) {
        if (len < 12 + (nsrcs << 2))
            ND_PRINT((ndo, " [invalid number of sources]"));
@@ -282,7 +282,7 @@ igmp_print(netdissect_options *ndo,
            } else
                ND_PRINT((ndo, " v1"));
             ND_TCHECK2(bp[4], 4);
-           if (EXTRACT_BE_32BITS(&bp[4]))
+           if (EXTRACT_BE_32BITS(bp + 4))
                 ND_PRINT((ndo, " [gaddr %s]", ipaddr_string(ndo, &bp[4])));
             if (len != 8)
                 ND_PRINT((ndo, " [len %d]", len));
@@ -333,7 +333,7 @@ igmp_print(netdissect_options *ndo,
         vec[0].ptr = bp;
         vec[0].len = len;
         if (in_cksum(vec, 1))
-            ND_PRINT((ndo, " bad igmp cksum %x!", EXTRACT_BE_16BITS(&bp[2])));
+            ND_PRINT((ndo, " bad igmp cksum %x!", EXTRACT_BE_16BITS(bp + 2)));
     }
     return;
 trunc:
index 5e68ee3b235c60aebe248434c5ec472d02366240..519cd793d30464839c07f3d93dbf2be9a2c20153 100644 (file)
@@ -220,7 +220,7 @@ ip_printts(netdissect_options *ndo,
                if (ptr == len)
                        type = " ^ ";
                ND_TCHECK2(cp[len], hoplen);
-               ND_PRINT((ndo, "%s%d@%s", type, EXTRACT_BE_32BITS(&cp[len + hoplen - 4]),
+               ND_PRINT((ndo, "%s%d@%s", type, EXTRACT_BE_32BITS(cp + len + hoplen - 4),
                          hoplen!=8 ? "" : ipaddr_string(ndo, &cp[len])));
                type = " ";
        }
@@ -302,8 +302,8 @@ ip_optprint(netdissect_options *ndo,
                                break;
                        }
                        ND_TCHECK(cp[3]);
-                       if (EXTRACT_BE_16BITS(&cp[2]) != 0)
-                               ND_PRINT((ndo, " value %u", EXTRACT_BE_16BITS(&cp[2])));
+                       if (EXTRACT_BE_16BITS(cp + 2) != 0)
+                               ND_PRINT((ndo, " value %u", EXTRACT_BE_16BITS(cp + 2)));
                        break;
 
                case IPOPT_NOP:       /* nothing to print - fall through */
index 90c34735a8da5d57d54c1fd465ec3da631b9d172..ff1d1246c424891b771d1a7066946504b99c6bb8 100644 (file)
@@ -125,7 +125,7 @@ ip6_opt_print(netdissect_options *ndo, const u_char *bp, int len)
                ND_PRINT((ndo, "(rtalert: invalid len %d)", bp[i + 1]));
                goto trunc;
            }
-           ND_PRINT((ndo, "(rtalert: 0x%04x) ", EXTRACT_BE_16BITS(&bp[i + 2])));
+           ND_PRINT((ndo, "(rtalert: 0x%04x) ", EXTRACT_BE_16BITS(bp + i + 2)));
            break;
        case IP6OPT_JUMBO:
            if (len - i < IP6OPT_JUMBO_LEN) {
@@ -136,7 +136,7 @@ ip6_opt_print(netdissect_options *ndo, const u_char *bp, int len)
                ND_PRINT((ndo, "(jumbo: invalid len %d)", bp[i + 1]));
                goto trunc;
            }
-           ND_PRINT((ndo, "(jumbo: %u) ", EXTRACT_BE_32BITS(&bp[i + 2])));
+           ND_PRINT((ndo, "(jumbo: %u) ", EXTRACT_BE_32BITS(bp + i + 2)));
            break;
         case IP6OPT_HOME_ADDRESS:
            if (len - i < IP6OPT_HOMEADDR_MINLEN) {
index c88c03a6d488f8a8f9a642d6e914949fbd415b86..9574d47753e5d753d5a376c66800676ecd52d70e 100644 (file)
@@ -165,7 +165,7 @@ ipx_sap_print(netdissect_options *ndo, const u_short *ipx, u_int length)
            ND_PRINT((ndo, "ipx-sap-nearest-req"));
 
        ND_TCHECK(ipx[0]);
-       ND_PRINT((ndo, " %s", ipxsap_string(ndo, htons(EXTRACT_BE_16BITS(&ipx[0])))));
+       ND_PRINT((ndo, " %s", ipxsap_string(ndo, htons(EXTRACT_BE_16BITS(ipx)))));
        break;
 
       case 2:
@@ -177,14 +177,14 @@ ipx_sap_print(netdissect_options *ndo, const u_short *ipx, u_int length)
 
        for (i = 0; i < 8 && length > 0; i++) {
            ND_TCHECK(ipx[0]);
-           ND_PRINT((ndo, " %s '", ipxsap_string(ndo, htons(EXTRACT_BE_16BITS(&ipx[0])))));
+           ND_PRINT((ndo, " %s '", ipxsap_string(ndo, htons(EXTRACT_BE_16BITS(ipx)))));
            if (fn_printzp(ndo, (const u_char *)&ipx[1], 48, ndo->ndo_snapend)) {
                ND_PRINT((ndo, "'"));
                goto trunc;
            }
            ND_TCHECK2(ipx[25], 10);
            ND_PRINT((ndo, "' addr %s",
-               ipxaddr_string(EXTRACT_BE_32BITS(&ipx[25]), (const u_char *)&ipx[27])));
+               ipxaddr_string(EXTRACT_BE_32BITS(ipx + 25), (const u_char *)&ipx[27])));
            ipx += 32;
            length -= 64;
        }
@@ -213,16 +213,16 @@ ipx_rip_print(netdissect_options *ndo, const u_short *ipx, u_int length)
        ND_PRINT((ndo, "ipx-rip-req"));
        if (length > 0) {
            ND_TCHECK(ipx[3]);
-           ND_PRINT((ndo, " %08x/%d.%d", EXTRACT_BE_32BITS(&ipx[0]),
-                        EXTRACT_BE_16BITS(&ipx[2]), EXTRACT_BE_16BITS(&ipx[3])));
+           ND_PRINT((ndo, " %08x/%d.%d", EXTRACT_BE_32BITS(ipx),
+                        EXTRACT_BE_16BITS(ipx + 2), EXTRACT_BE_16BITS(ipx + 3)));
        }
        break;
       case 2:
        ND_PRINT((ndo, "ipx-rip-resp"));
        for (i = 0; i < 50 && length > 0; i++) {
            ND_TCHECK(ipx[3]);
-           ND_PRINT((ndo, " %08x/%d.%d", EXTRACT_BE_32BITS(&ipx[0]),
-                        EXTRACT_BE_16BITS(&ipx[2]), EXTRACT_BE_16BITS(&ipx[3])));
+           ND_PRINT((ndo, " %08x/%d.%d", EXTRACT_BE_32BITS(ipx),
+                        EXTRACT_BE_16BITS(ipx + 2), EXTRACT_BE_16BITS(ipx + 3)));
 
            ipx += 4;
            length -= 8;
index d38b473244be70f5c051d4b2c3877f6a26ad2e6c..a3eb0bea69faa73c37dc84fc566edd7baed64091 100644 (file)
@@ -923,7 +923,7 @@ ikev1_attrmap_print(netdissect_options *ndo,
                totlen = 4;
        else {
                ND_TCHECK_16BITS(&p[2]);
-               totlen = 4 + EXTRACT_BE_16BITS(&p[2]);
+               totlen = 4 + EXTRACT_BE_16BITS(p + 2);
        }
        if (ep2 < p + totlen) {
                ND_PRINT((ndo,"[|attr]"));
@@ -932,7 +932,7 @@ ikev1_attrmap_print(netdissect_options *ndo,
 
        ND_TCHECK_16BITS(&p[0]);
        ND_PRINT((ndo,"("));
-       t = EXTRACT_BE_16BITS(&p[0]) & 0x7fff;
+       t = EXTRACT_BE_16BITS(p) & 0x7fff;
        if (map && t < nmap && map[t].type)
                ND_PRINT((ndo,"type=%s ", map[t].type));
        else
@@ -940,7 +940,7 @@ ikev1_attrmap_print(netdissect_options *ndo,
        if (p[0] & 0x80) {
                ND_PRINT((ndo,"value="));
                ND_TCHECK_16BITS(&p[2]);
-               v = EXTRACT_BE_16BITS(&p[2]);
+               v = EXTRACT_BE_16BITS(p + 2);
                if (map && t < nmap && v < map[t].nvalue && map[t].value[v])
                        ND_PRINT((ndo,"%s", map[t].value[v]));
                else {
@@ -974,7 +974,7 @@ ikev1_attr_print(netdissect_options *ndo, const u_char *p, const u_char *ep2)
                totlen = 4;
        else {
                ND_TCHECK_16BITS(&p[2]);
-               totlen = 4 + EXTRACT_BE_16BITS(&p[2]);
+               totlen = 4 + EXTRACT_BE_16BITS(p + 2);
        }
        if (ep2 < p + totlen) {
                ND_PRINT((ndo,"[|attr]"));
@@ -983,7 +983,7 @@ ikev1_attr_print(netdissect_options *ndo, const u_char *p, const u_char *ep2)
 
        ND_TCHECK_16BITS(&p[0]);
        ND_PRINT((ndo,"("));
-       t = EXTRACT_BE_16BITS(&p[0]) & 0x7fff;
+       t = EXTRACT_BE_16BITS(p) & 0x7fff;
        ND_PRINT((ndo,"type=#%d ", t));
        if (p[0] & 0x80) {
                ND_PRINT((ndo,"value="));
index 17564b37224e94035f60deba64f877775307a1c3..9d2ebccba21c38ee813043a8883ba45175beb0e5 100644 (file)
@@ -152,7 +152,7 @@ mobility_opt_print(netdissect_options *ndo,
                        /* units of 4 secs */
                        ND_TCHECK_16BITS(&bp[i+2]);
                        ND_PRINT((ndo, "(refresh: %u)",
-                               EXTRACT_BE_16BITS(&bp[i + 2]) << 2));
+                               EXTRACT_BE_16BITS(bp + i + 2) << 2));
                        break;
                case IP6MOPT_ALTCOA:
                        if (len - i < IP6MOPT_ALTCOA_MINLEN) {
@@ -170,8 +170,8 @@ mobility_opt_print(netdissect_options *ndo,
                        ND_TCHECK_16BITS(&bp[i+2]);
                        ND_TCHECK_16BITS(&bp[i+4]);
                        ND_PRINT((ndo, "(ni: ho=0x%04x co=0x%04x)",
-                               EXTRACT_BE_16BITS(&bp[i + 2]),
-                               EXTRACT_BE_16BITS(&bp[i + 4])));
+                               EXTRACT_BE_16BITS(bp + i + 2),
+                               EXTRACT_BE_16BITS(bp + i + 4)));
                        break;
                case IP6MOPT_AUTH:
                        if (len - i < IP6MOPT_AUTH_MINLEN) {
@@ -250,8 +250,8 @@ mobility_print(netdissect_options *ndo,
                        ND_TCHECK_32BITS(&bp[hlen + 4]);
                        ND_PRINT((ndo, " %s Init Cookie=%08x:%08x",
                               type == IP6M_HOME_TEST_INIT ? "Home" : "Care-of",
-                              EXTRACT_BE_32BITS(&bp[hlen]),
-                              EXTRACT_BE_32BITS(&bp[hlen + 4])));
+                              EXTRACT_BE_32BITS(bp + hlen),
+                              EXTRACT_BE_32BITS(bp + hlen + 4)));
                }
                hlen += 8;
                break;
@@ -264,16 +264,16 @@ mobility_print(netdissect_options *ndo,
                        ND_TCHECK_32BITS(&bp[hlen + 4]);
                        ND_PRINT((ndo, " %s Init Cookie=%08x:%08x",
                               type == IP6M_HOME_TEST ? "Home" : "Care-of",
-                              EXTRACT_BE_32BITS(&bp[hlen]),
-                              EXTRACT_BE_32BITS(&bp[hlen + 4])));
+                              EXTRACT_BE_32BITS(bp + hlen),
+                              EXTRACT_BE_32BITS(bp + hlen + 4)));
                }
                hlen += 8;
                if (ndo->ndo_vflag) {
                        ND_TCHECK_32BITS(&bp[hlen + 4]);
                        ND_PRINT((ndo, " %s Keygen Token=%08x:%08x",
                               type == IP6M_HOME_TEST ? "Home" : "Care-of",
-                              EXTRACT_BE_32BITS(&bp[hlen]),
-                              EXTRACT_BE_32BITS(&bp[hlen + 4])));
+                              EXTRACT_BE_32BITS(bp + hlen),
+                              EXTRACT_BE_32BITS(bp + hlen + 4)));
                }
                hlen += 8;
                break;
@@ -299,7 +299,7 @@ mobility_print(netdissect_options *ndo,
                hlen += 1;
                ND_TCHECK_16BITS(&bp[hlen]);
                /* units of 4 secs */
-               ND_PRINT((ndo, " lifetime=%u", EXTRACT_BE_16BITS(&bp[hlen]) << 2));
+               ND_PRINT((ndo, " lifetime=%u", EXTRACT_BE_16BITS(bp + hlen) << 2));
                hlen += 2;
                break;
        case IP6M_BINDING_ACK:
@@ -311,11 +311,11 @@ mobility_print(netdissect_options *ndo,
                /* Reserved (7bits) */
                hlen = IP6M_MINLEN;
                ND_TCHECK_16BITS(&bp[hlen]);
-               ND_PRINT((ndo, " seq#=%u", EXTRACT_BE_16BITS(&bp[hlen])));
+               ND_PRINT((ndo, " seq#=%u", EXTRACT_BE_16BITS(bp + hlen)));
                hlen += 2;
                ND_TCHECK_16BITS(&bp[hlen]);
                /* units of 4 secs */
-               ND_PRINT((ndo, " lifetime=%u", EXTRACT_BE_16BITS(&bp[hlen]) << 2));
+               ND_PRINT((ndo, " lifetime=%u", EXTRACT_BE_16BITS(bp + hlen) << 2));
                hlen += 2;
                break;
        case IP6M_BINDING_ERROR:
index 7be695fdfa229ac2593b08bcc1981b476da3b6ad..cf771b0b4c1a89613b521c2f663df33ec25196d6 100644 (file)
@@ -426,11 +426,11 @@ parsereq(netdissect_options *ndo,
         */
        dp = (const uint32_t *)&rp->rm_call.cb_cred;
        ND_TCHECK(dp[1]);
-       len = EXTRACT_BE_32BITS(&dp[1]);
+       len = EXTRACT_BE_32BITS(dp + 1);
        if (len < length) {
                dp += (len + (2 * sizeof(*dp) + 3)) / sizeof(*dp);
                ND_TCHECK(dp[1]);
-               len = EXTRACT_BE_32BITS(&dp[1]);
+               len = EXTRACT_BE_32BITS(dp + 1);
                if (len < length) {
                        dp += (len + (2 * sizeof(*dp) + 3)) / sizeof(*dp);
                        ND_TCHECK2(dp[0], 0);
@@ -571,7 +571,7 @@ nfsreq_noaddr_print(netdissect_options *ndo,
                if ((dp = parsereq(ndo, rp, length)) != NULL &&
                    (dp = parsefh(ndo, dp, v3)) != NULL) {
                        ND_TCHECK(dp[0]);
-                       access_flags = EXTRACT_BE_32BITS(&dp[0]);
+                       access_flags = EXTRACT_BE_32BITS(dp);
                        if (access_flags & ~NFSV3ACCESS_FULL) {
                                /* NFSV3ACCESS definitions aren't up to date */
                                ND_PRINT((ndo, " %04x", access_flags));
@@ -612,13 +612,13 @@ nfsreq_noaddr_print(netdissect_options *ndo,
                        if (v3) {
                                ND_TCHECK(dp[2]);
                                ND_PRINT((ndo, " %u bytes @ %" PRIu64,
-                                      EXTRACT_BE_32BITS(&dp[2]),
-                                      EXTRACT_BE_64BITS(&dp[0])));
+                                      EXTRACT_BE_32BITS(dp + 2),
+                                      EXTRACT_BE_64BITS(dp)));
                        } else {
                                ND_TCHECK(dp[1]);
                                ND_PRINT((ndo, " %u bytes @ %u",
-                                   EXTRACT_BE_32BITS(&dp[1]),
-                                   EXTRACT_BE_32BITS(&dp[0])));
+                                   EXTRACT_BE_32BITS(dp + 1),
+                                   EXTRACT_BE_32BITS(dp)));
                        }
                        return;
                }
@@ -630,21 +630,21 @@ nfsreq_noaddr_print(netdissect_options *ndo,
                        if (v3) {
                                ND_TCHECK(dp[4]);
                                ND_PRINT((ndo, " %u (%u) bytes @ %" PRIu64,
-                                               EXTRACT_BE_32BITS(&dp[4]),
-                                               EXTRACT_BE_32BITS(&dp[2]),
-                                               EXTRACT_BE_64BITS(&dp[0])));
+                                               EXTRACT_BE_32BITS(dp + 4),
+                                               EXTRACT_BE_32BITS(dp + 2),
+                                               EXTRACT_BE_64BITS(dp)));
                                if (ndo->ndo_vflag) {
                                        ND_PRINT((ndo, " <%s>",
                                                tok2str(nfsv3_writemodes,
-                                                       NULL, EXTRACT_BE_32BITS(&dp[3]))));
+                                                       NULL, EXTRACT_BE_32BITS(dp + 3))));
                                }
                        } else {
                                ND_TCHECK(dp[3]);
                                ND_PRINT((ndo, " %u (%u) bytes @ %u (%u)",
-                                               EXTRACT_BE_32BITS(&dp[3]),
-                                               EXTRACT_BE_32BITS(&dp[2]),
-                                               EXTRACT_BE_32BITS(&dp[1]),
-                                               EXTRACT_BE_32BITS(&dp[0])));
+                                               EXTRACT_BE_32BITS(dp + 3),
+                                               EXTRACT_BE_32BITS(dp + 2),
+                                               EXTRACT_BE_32BITS(dp + 1),
+                                               EXTRACT_BE_32BITS(dp)));
                        }
                        return;
                }
@@ -676,8 +676,8 @@ nfsreq_noaddr_print(netdissect_options *ndo,
                        if (ndo->ndo_vflag && (type == NFCHR || type == NFBLK)) {
                                ND_TCHECK(dp[1]);
                                ND_PRINT((ndo, " %u/%u",
-                                      EXTRACT_BE_32BITS(&dp[0]),
-                                      EXTRACT_BE_32BITS(&dp[1])));
+                                      EXTRACT_BE_32BITS(dp),
+                                      EXTRACT_BE_32BITS(dp + 1)));
                                dp += 2;
                        }
                        if (ndo->ndo_vflag)
@@ -714,8 +714,8 @@ nfsreq_noaddr_print(netdissect_options *ndo,
                                 * offset cookie here.
                                 */
                                ND_PRINT((ndo, " %u bytes @ %" PRId64,
-                                   EXTRACT_BE_32BITS(&dp[4]),
-                                   EXTRACT_BE_64BITS(&dp[0])));
+                                   EXTRACT_BE_32BITS(dp + 4),
+                                   EXTRACT_BE_64BITS(dp)));
                                if (ndo->ndo_vflag)
                                        ND_PRINT((ndo, " verf %08x%08x", dp[2], dp[3]));
                        } else {
@@ -725,8 +725,8 @@ nfsreq_noaddr_print(netdissect_options *ndo,
                                 * common, but offsets > 2^31 aren't.
                                 */
                                ND_PRINT((ndo, " %u bytes @ %d",
-                                   EXTRACT_BE_32BITS(&dp[1]),
-                                   EXTRACT_BE_32BITS(&dp[0])));
+                                   EXTRACT_BE_32BITS(dp + 1),
+                                   EXTRACT_BE_32BITS(dp)));
                        }
                        return;
                }
@@ -741,12 +741,12 @@ nfsreq_noaddr_print(netdissect_options *ndo,
                         * cookie here.
                         */
                        ND_PRINT((ndo, " %u bytes @ %" PRId64,
-                               EXTRACT_BE_32BITS(&dp[4]),
-                               EXTRACT_BE_64BITS(&dp[0])));
+                               EXTRACT_BE_32BITS(dp + 4),
+                               EXTRACT_BE_64BITS(dp)));
                        if (ndo->ndo_vflag) {
                                ND_TCHECK(dp[5]);
                                ND_PRINT((ndo, " max %u verf %08x%08x",
-                                      EXTRACT_BE_32BITS(&dp[5]), dp[2], dp[3]));
+                                      EXTRACT_BE_32BITS(dp + 5), dp[2], dp[3]));
                        }
                        return;
                }
@@ -757,8 +757,8 @@ nfsreq_noaddr_print(netdissect_options *ndo,
                    (dp = parsefh(ndo, dp, v3)) != NULL) {
                        ND_TCHECK(dp[2]);
                        ND_PRINT((ndo, " %u bytes @ %" PRIu64,
-                               EXTRACT_BE_32BITS(&dp[2]),
-                               EXTRACT_BE_64BITS(&dp[0])));
+                               EXTRACT_BE_32BITS(dp + 2),
+                               EXTRACT_BE_64BITS(dp)));
                        return;
                }
                break;
@@ -997,7 +997,7 @@ parserep(netdissect_options *ndo,
         */
        dp = ((const uint32_t *)&rp->rm_reply) + 1;
        ND_TCHECK(dp[1]);
-       len = EXTRACT_BE_32BITS(&dp[1]);
+       len = EXTRACT_BE_32BITS(dp + 1);
        if (len >= length)
                return (NULL);
        /*
@@ -1030,7 +1030,7 @@ parsestatus(netdissect_options *ndo,
 
        ND_TCHECK(dp[0]);
 
-       errnum = EXTRACT_BE_32BITS(&dp[0]);
+       errnum = EXTRACT_BE_32BITS(dp);
        if (er)
                *er = errnum;
        if (errnum != 0) {
@@ -1232,7 +1232,7 @@ parserddires(netdissect_options *ndo,
 
        ND_TCHECK(dp[2]);
        ND_PRINT((ndo, " offset 0x%x size %d ",
-              EXTRACT_BE_32BITS(&dp[0]), EXTRACT_BE_32BITS(&dp[1])));
+              EXTRACT_BE_32BITS(dp), EXTRACT_BE_32BITS(dp + 1)));
        if (dp[2] != 0)
                ND_PRINT((ndo, " eof"));
 
@@ -1246,10 +1246,10 @@ parse_wcc_attr(netdissect_options *ndo,
                const uint32_t *dp)
 {
        /* Our caller has already checked this */
-       ND_PRINT((ndo, " sz %" PRIu64, EXTRACT_BE_64BITS(&dp[0])));
+       ND_PRINT((ndo, " sz %" PRIu64, EXTRACT_BE_64BITS(dp)));
        ND_PRINT((ndo, " mtime %u.%06u ctime %u.%06u",
-              EXTRACT_BE_32BITS(&dp[2]), EXTRACT_BE_32BITS(&dp[3]),
-              EXTRACT_BE_32BITS(&dp[4]), EXTRACT_BE_32BITS(&dp[5])));
+              EXTRACT_BE_32BITS(dp + 2), EXTRACT_BE_32BITS(dp + 3),
+              EXTRACT_BE_32BITS(dp + 4), EXTRACT_BE_32BITS(dp + 5)));
        return (dp + 6);
 }
 
@@ -1261,7 +1261,7 @@ parse_pre_op_attr(netdissect_options *ndo,
                   const uint32_t *dp, int verbose)
 {
        ND_TCHECK(dp[0]);
-       if (!EXTRACT_BE_32BITS(&dp[0]))
+       if (!EXTRACT_BE_32BITS(dp))
                return (dp + 1);
        dp++;
        ND_TCHECK2(*dp, 24);
@@ -1283,7 +1283,7 @@ parse_post_op_attr(netdissect_options *ndo,
                    const uint32_t *dp, int verbose)
 {
        ND_TCHECK(dp[0]);
-       if (!EXTRACT_BE_32BITS(&dp[0]))
+       if (!EXTRACT_BE_32BITS(dp))
                return (dp + 1);
        dp++;
        if (verbose) {
@@ -1320,7 +1320,7 @@ parsecreateopres(netdissect_options *ndo,
                dp = parse_wcc_data(ndo, dp, verbose);
        else {
                ND_TCHECK(dp[0]);
-               if (!EXTRACT_BE_32BITS(&dp[0]))
+               if (!EXTRACT_BE_32BITS(dp))
                        return (dp + 1);
                dp++;
                if (!(dp = parsefh(ndo, dp, 1)))
@@ -1516,7 +1516,7 @@ interp_reply(netdissect_options *ndo,
                        break;
                if (!er) {
                        ND_TCHECK(dp[0]);
-                       ND_PRINT((ndo, " c %04x", EXTRACT_BE_32BITS(&dp[0])));
+                       ND_PRINT((ndo, " c %04x", EXTRACT_BE_32BITS(dp)));
                }
                return;
 
@@ -1538,8 +1538,8 @@ interp_reply(netdissect_options *ndo,
                                return;
                        if (ndo->ndo_vflag) {
                                ND_TCHECK(dp[1]);
-                               ND_PRINT((ndo, " %u bytes", EXTRACT_BE_32BITS(&dp[0])));
-                               if (EXTRACT_BE_32BITS(&dp[1]))
+                               ND_PRINT((ndo, " %u bytes", EXTRACT_BE_32BITS(dp)));
+                               if (EXTRACT_BE_32BITS(dp + 1))
                                        ND_PRINT((ndo, " EOF"));
                        }
                        return;
@@ -1561,12 +1561,12 @@ interp_reply(netdissect_options *ndo,
                                return;
                        if (ndo->ndo_vflag) {
                                ND_TCHECK(dp[0]);
-                               ND_PRINT((ndo, " %u bytes", EXTRACT_BE_32BITS(&dp[0])));
+                               ND_PRINT((ndo, " %u bytes", EXTRACT_BE_32BITS(dp)));
                                if (ndo->ndo_vflag > 1) {
                                        ND_TCHECK(dp[1]);
                                        ND_PRINT((ndo, " <%s>",
                                                tok2str(nfsv3_writemodes,
-                                                       NULL, EXTRACT_BE_32BITS(&dp[1]))));
+                                                       NULL, EXTRACT_BE_32BITS(dp + 1))));
                                }
                                return;
                        }
index 97123e3fe329ccdd7399c07f3d1c3a17c58dfaa7..7d6b477aab3ac24304dd4b3d203979ce6f4d01af 100644 (file)
@@ -148,11 +148,11 @@ pimv1_join_prune_print(netdissect_options *ndo,
 
        /* If it's a single group and a single source, use 1-line output. */
        if (ND_TTEST2(bp[0], 30) && bp[11] == 1 &&
-           ((njoin = EXTRACT_BE_16BITS(&bp[20])) + EXTRACT_BE_16BITS(&bp[22])) == 1) {
+           ((njoin = EXTRACT_BE_16BITS(bp + 20)) + EXTRACT_BE_16BITS(bp + 22)) == 1) {
                int hold;
 
                ND_PRINT((ndo, " RPF %s ", ipaddr_string(ndo, bp)));
-               hold = EXTRACT_BE_16BITS(&bp[6]);
+               hold = EXTRACT_BE_16BITS(bp + 6);
                if (hold != 180) {
                        ND_PRINT((ndo, "Hold "));
                        unsigned_relts_print(ndo, hold);
@@ -160,7 +160,7 @@ pimv1_join_prune_print(netdissect_options *ndo,
                ND_PRINT((ndo, "%s (%s/%d, %s", njoin ? "Join" : "Prune",
                ipaddr_string(ndo, &bp[26]), bp[25] & 0x3f,
                ipaddr_string(ndo, &bp[12])));
-               if (EXTRACT_BE_32BITS(&bp[16]) != 0xffffffff)
+               if (EXTRACT_BE_32BITS(bp + 16) != 0xffffffff)
                        ND_PRINT((ndo, "/%s", ipaddr_string(ndo, &bp[16])));
                ND_PRINT((ndo, ") %s%s %s",
                    (bp[24] & 0x01) ? "Sparse" : "Dense",
@@ -183,7 +183,7 @@ pimv1_join_prune_print(netdissect_options *ndo,
        if (ndo->ndo_vflag > 1)
                ND_PRINT((ndo, "\n"));
        ND_PRINT((ndo, " Hold time: "));
-       unsigned_relts_print(ndo, EXTRACT_BE_16BITS(&bp[2]));
+       unsigned_relts_print(ndo, EXTRACT_BE_16BITS(bp + 2));
        if (ndo->ndo_vflag < 2)
                return;
        bp += 4;
@@ -209,15 +209,15 @@ pimv1_join_prune_print(netdissect_options *ndo,
                if (len < 4)
                        goto trunc;
                ND_TCHECK2(bp[0], sizeof(struct in_addr));
-               if (EXTRACT_BE_32BITS(&bp[0]) != 0xffffffff)
+               if (EXTRACT_BE_32BITS(bp) != 0xffffffff)
                        ND_PRINT((ndo, "/%s", ipaddr_string(ndo, &bp[0])));
                bp += 4;
                len -= 4;
                if (len < 4)
                        goto trunc;
                ND_TCHECK2(bp[0], 4);
-               njoin = EXTRACT_BE_16BITS(&bp[0]);
-               nprune = EXTRACT_BE_16BITS(&bp[2]);
+               njoin = EXTRACT_BE_16BITS(bp);
+               nprune = EXTRACT_BE_16BITS(bp + 2);
                ND_PRINT((ndo, " joined: %d pruned: %d", njoin, nprune));
                bp += 4;
                len -= 4;
@@ -278,7 +278,7 @@ pimv1_print(netdissect_options *ndo,
                if (ndo->ndo_vflag) {
                        ND_TCHECK2(bp[10],2);
                        ND_PRINT((ndo, " (Hold-time "));
-                       unsigned_relts_print(ndo, EXTRACT_BE_16BITS(&bp[10]));
+                       unsigned_relts_print(ndo, EXTRACT_BE_16BITS(bp + 10));
                        ND_PRINT((ndo, ")"));
                }
                break;
@@ -297,23 +297,23 @@ pimv1_print(netdissect_options *ndo,
                if (ndo->ndo_vflag) {
                        ND_TCHECK2(bp[22], 2);
                        ND_PRINT((ndo, " group %s", ipaddr_string(ndo, &bp[8])));
-                       if (EXTRACT_BE_32BITS(&bp[12]) != 0xffffffff)
+                       if (EXTRACT_BE_32BITS(bp + 12) != 0xffffffff)
                                ND_PRINT((ndo, "/%s", ipaddr_string(ndo, &bp[12])));
                        ND_PRINT((ndo, " RP %s hold ", ipaddr_string(ndo, &bp[16])));
-                       unsigned_relts_print(ndo, EXTRACT_BE_16BITS(&bp[22]));
+                       unsigned_relts_print(ndo, EXTRACT_BE_16BITS(bp + 22));
                }
                break;
        case PIMV1_TYPE_ASSERT:
                ND_TCHECK2(bp[16], sizeof(struct in_addr));
                ND_PRINT((ndo, " for %s > %s", ipaddr_string(ndo, &bp[16]),
                    ipaddr_string(ndo, &bp[8])));
-               if (EXTRACT_BE_32BITS(&bp[12]) != 0xffffffff)
+               if (EXTRACT_BE_32BITS(bp + 12) != 0xffffffff)
                        ND_PRINT((ndo, "/%s", ipaddr_string(ndo, &bp[12])));
                ND_TCHECK2(bp[24], 4);
                ND_PRINT((ndo, " %s pref %d metric %d",
                    (bp[20] & 0x80) ? "RP-tree" : "SPT",
-               EXTRACT_BE_32BITS(&bp[20]) & 0x7fffffff,
-               EXTRACT_BE_32BITS(&bp[24])));
+               EXTRACT_BE_32BITS(bp + 20) & 0x7fffffff,
+               EXTRACT_BE_32BITS(bp + 24)));
                break;
        case PIMV1_TYPE_JOIN_PRUNE:
        case PIMV1_TYPE_GRAFT:
@@ -371,9 +371,9 @@ cisco_autorp_print(netdissect_options *ndo,
 
        ND_TCHECK2(bp[2], 2);
        ND_PRINT((ndo, " Hold "));
-       hold = EXTRACT_BE_16BITS(&bp[2]);
+       hold = EXTRACT_BE_16BITS(bp + 2);
        if (hold)
-               unsigned_relts_print(ndo, EXTRACT_BE_16BITS(&bp[2]));
+               unsigned_relts_print(ndo, EXTRACT_BE_16BITS(bp + 2));
        else
                ND_PRINT((ndo, "FOREVER"));
 
@@ -760,8 +760,8 @@ pimv2_print(netdissect_options *ndo,
                        if (len < 4)
                                goto trunc;
                        ND_TCHECK2(bp[0], 4);
-                       otype = EXTRACT_BE_16BITS(&bp[0]);
-                       olen = EXTRACT_BE_16BITS(&bp[2]);
+                       otype = EXTRACT_BE_16BITS(bp);
+                       olen = EXTRACT_BE_16BITS(bp + 2);
                        ND_PRINT((ndo, "\n\t  %s Option (%u), length %u, Value: ",
                                  tok2str(pimv2_hello_option_values, "Unknown", otype),
                                  otype,
@@ -977,7 +977,7 @@ pimv2_print(netdissect_options *ndo,
                        goto trunc;
                ND_TCHECK2(*bp, 4);
                ngroup = bp[1];
-               holdtime = EXTRACT_BE_16BITS(&bp[2]);
+               holdtime = EXTRACT_BE_16BITS(bp + 2);
                ND_PRINT((ndo, "\n\t  %u group(s)", ngroup));
                if (PIM_TYPE(pim->pim_typever) != 7) {  /*not for Graft-ACK*/
                        ND_PRINT((ndo, ", holdtime: "));
@@ -995,8 +995,8 @@ pimv2_print(netdissect_options *ndo,
                        if (len < 4)
                                goto trunc;
                        ND_TCHECK2(*bp, 4);
-                       njoin = EXTRACT_BE_16BITS(&bp[0]);
-                       nprune = EXTRACT_BE_16BITS(&bp[2]);
+                       njoin = EXTRACT_BE_16BITS(bp);
+                       nprune = EXTRACT_BE_16BITS(bp + 2);
                        ND_PRINT((ndo, ", joined sources: %u, pruned sources: %u", njoin, nprune));
                        bp += 4; len -= 4;
                        for (j = 0; j < njoin; j++) {
@@ -1110,8 +1110,8 @@ pimv2_print(netdissect_options *ndo,
                ND_TCHECK2(*bp, 8);
                if (bp[0] & 0x80)
                        ND_PRINT((ndo, " RPT"));
-               ND_PRINT((ndo, " pref=%u", EXTRACT_BE_32BITS(&bp[0]) & 0x7fffffff));
-               ND_PRINT((ndo, " metric=%u", EXTRACT_BE_32BITS(&bp[4])));
+               ND_PRINT((ndo, " pref=%u", EXTRACT_BE_32BITS(bp) & 0x7fffffff));
+               ND_PRINT((ndo, " metric=%u", EXTRACT_BE_32BITS(bp + 4)));
                break;
 
        case PIMV2_TYPE_CANDIDATE_RP:
@@ -1132,7 +1132,7 @@ pimv2_print(netdissect_options *ndo,
                        goto trunc;
                ND_TCHECK_16BITS(&bp[2]);
                ND_PRINT((ndo, " holdtime="));
-               unsigned_relts_print(ndo, EXTRACT_BE_16BITS(&bp[2]));
+               unsigned_relts_print(ndo, EXTRACT_BE_16BITS(bp + 2));
                bp += 4;
                len -= 4;
 
index fb46a0e5b9c7c463743ff2e89dbe3f461287c71f..a89c514a3d2d787d2eba1b879bf69e11d7eb7fd8 100644 (file)
@@ -821,7 +821,7 @@ print_smb(netdissect_options *ndo,
        return;
 
     ND_TCHECK_16BITS(&buf[10]);
-    flags2 = EXTRACT_LE_16BITS(&buf[10]);
+    flags2 = EXTRACT_LE_16BITS(buf + 10);
     unicodestr = flags2 & 0x8000;
     nterrcodes = flags2 & 0x4000;
 
@@ -829,12 +829,12 @@ print_smb(netdissect_options *ndo,
     smb_fdata(ndo, buf, fmt_smbheader, buf + 33, unicodestr);
 
     if (nterrcodes) {
-       nterror = EXTRACT_LE_32BITS(&buf[5]);
+       nterror = EXTRACT_LE_32BITS(buf + 5);
        if (nterror)
            ND_PRINT((ndo, "NTError = %s\n", nt_errstr(nterror)));
     } else {
        if (buf[5])
-           ND_PRINT((ndo, "SMBError = %s\n", smb_errstr(buf[5], EXTRACT_LE_16BITS(&buf[7]))));
+           ND_PRINT((ndo, "SMBError = %s\n", smb_errstr(buf[5], EXTRACT_LE_16BITS(buf + 7))));
     }
 
     smboffset = 32;
index 4cadcc371a7fc43951309cae74425e0bbc5b9a83..8c0b26a85b5a5b6c9841d38031c9790f1c9540ac 100644 (file)
@@ -96,7 +96,7 @@ sunatm_if_print(netdissect_options *ndo,
                break;
        }
 
-       vci = EXTRACT_BE_16BITS(&p[VCI_POS]);
+       vci = EXTRACT_BE_16BITS(p + VCI_POS);
        vpi = p[VPI_POS];
 
        p += PKT_BEGIN_POS;
index e2bfce146fb88b0be77527028df1392d683a228e..fef1e3e01971b2af60f24760ab46024ece408dc3 100644 (file)
@@ -144,7 +144,7 @@ vrrp_print(netdissect_options *ndo,
                        vec[0].len = len;
                        if (in_cksum(vec, 1))
                                ND_PRINT((ndo, ", (bad vrrp cksum %x)",
-                                       EXTRACT_BE_16BITS(&bp[6])));
+                                       EXTRACT_BE_16BITS(bp + 6)));
                }
 
                if (version == 3 && ND_TTEST2(bp[0], len)) {
@@ -152,7 +152,7 @@ vrrp_print(netdissect_options *ndo,
                                len, len, IPPROTO_VRRP);
                        if (cksum)
                                ND_PRINT((ndo, ", (bad vrrp cksum %x)",
-                                       EXTRACT_BE_16BITS(&bp[6])));
+                                       EXTRACT_BE_16BITS(bp + 6)));
                }
 
                ND_PRINT((ndo, ", addrs"));