]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use nd_ types, clean up signed vs. unsigned.
authorGuy Harris <[email protected]>
Sun, 31 Dec 2017 01:14:11 +0000 (17:14 -0800)
committerGuy Harris <[email protected]>
Sun, 31 Dec 2017 01:14:11 +0000 (17:14 -0800)
print-mobile.c

index 5f9f54fe8390c0d8af7b229cebf2bfc3b87e6d8f..37ffe5e0302ddd51071941e2eab803058e39b95c 100644 (file)
 #define MOBILE_SIZE (8)
 
 struct mobile_ip {
-       uint16_t proto;
-       uint16_t hcheck;
-       uint32_t odst;
-       uint32_t osrc;
+       nd_uint16_t proto;
+       nd_uint16_t hcheck;
+       nd_uint32_t odst;
+       nd_uint32_t osrc;
 };
 
 #define OSRC_PRES      0x0080  /* old source is present */
@@ -78,8 +78,8 @@ mobile_print(netdissect_options *ndo, const u_char *bp, u_int length)
        }
        ND_PRINT((ndo, "mobile: "));
 
-       proto = EXTRACT_BE_U_2(&mob->proto);
-       crc =  EXTRACT_BE_U_2(&mob->hcheck);
+       proto = EXTRACT_BE_U_2(mob->proto);
+       crc =  EXTRACT_BE_U_2(mob->hcheck);
        if (proto & OSRC_PRES) {
                osp=1;
        }
@@ -93,11 +93,11 @@ mobile_print(netdissect_options *ndo, const u_char *bp, u_int length)
        }
        if (ndo->ndo_vflag) {
                ND_PRINT((ndo, "> %s ", ipaddr_string(ndo, &mob->odst)));
-               ND_PRINT((ndo, "(oproto=%d)", proto>>8));
+               ND_PRINT((ndo, "(oproto=%u)", proto>>8));
        }
        vec[0].ptr = (const uint8_t *)(const void *)mob;
        vec[0].len = osp ? 12 : 8;
        if (in_cksum(vec, 1)!=0) {
-               ND_PRINT((ndo, " (bad checksum %d)", crc));
+               ND_PRINT((ndo, " (bad checksum %u)", crc));
        }
 }