]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use more the EXTRACT_U_1() macro (31/n)
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 27 Nov 2017 17:38:56 +0000 (18:38 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 27 Nov 2017 19:57:24 +0000 (20:57 +0100)
In ND_PRINT() macro call(s) (step 9).

*(p)

24 files changed:
print-ahcp.c
print-aoe.c
print-bfd.c
print-cdp.c
print-cfm.c
print-dccp.c
print-domain.c
print-isoclns.c
print-krb.c
print-lldp.c
print-msdp.c
print-openflow-1.0.c
print-ospf.c
print-pim.c
print-pppoe.c
print-pptp.c
print-radius.c
print-rip.c
print-rpki-rtr.c
print-snmp.c
print-tcp.c
print-udld.c
print-vtp.c
smbutil.c

index 2ef41618a62b6fe98efe26d58c3acc704ac8f127..0600290316c2f20211f0dd62764fc0e78d986601 100644 (file)
@@ -373,11 +373,11 @@ ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len)
                        } else {
                                /* Hopcount */
                                ND_TCHECK_1(cp);
-                               ND_PRINT((ndo, "\n\tHopcount %u", *cp));
+                               ND_PRINT((ndo, "\n\tHopcount %u", EXTRACT_U_1(cp)));
                                cp += 1;
                                /* Original Hopcount */
                                ND_TCHECK_1(cp);
-                               ND_PRINT((ndo, ", Original Hopcount %u", *cp));
+                               ND_PRINT((ndo, ", Original Hopcount %u", EXTRACT_U_1(cp)));
                                cp += 1;
                                /* Nonce */
                                ND_TCHECK_4(cp);
index dfc5e3157bbae06414f33664525d25a8d0a974b9..75a67342d248af08063a84007de8e6cec914f307 100644 (file)
@@ -153,39 +153,39 @@ aoev1_issue_print(netdissect_options *ndo,
        cp += 1;
        /* Err/Feature */
        ND_TCHECK_1(cp);
-       ND_PRINT((ndo, ", Err/Feature: %u", *cp));
+       ND_PRINT((ndo, ", Err/Feature: %u", EXTRACT_U_1(cp)));
        cp += 1;
        /* Sector Count (not correlated with the length) */
        ND_TCHECK_1(cp);
-       ND_PRINT((ndo, ", Sector Count: %u", *cp));
+       ND_PRINT((ndo, ", Sector Count: %u", EXTRACT_U_1(cp)));
        cp += 1;
        /* Cmd/Status */
        ND_TCHECK_1(cp);
-       ND_PRINT((ndo, ", Cmd/Status: %u", *cp));
+       ND_PRINT((ndo, ", Cmd/Status: %u", EXTRACT_U_1(cp)));
        cp += 1;
        /* lba0 */
        ND_TCHECK_1(cp);
-       ND_PRINT((ndo, "\n\tlba0: %u", *cp));
+       ND_PRINT((ndo, "\n\tlba0: %u", EXTRACT_U_1(cp)));
        cp += 1;
        /* lba1 */
        ND_TCHECK_1(cp);
-       ND_PRINT((ndo, ", lba1: %u", *cp));
+       ND_PRINT((ndo, ", lba1: %u", EXTRACT_U_1(cp)));
        cp += 1;
        /* lba2 */
        ND_TCHECK_1(cp);
-       ND_PRINT((ndo, ", lba2: %u", *cp));
+       ND_PRINT((ndo, ", lba2: %u", EXTRACT_U_1(cp)));
        cp += 1;
        /* lba3 */
        ND_TCHECK_1(cp);
-       ND_PRINT((ndo, ", lba3: %u", *cp));
+       ND_PRINT((ndo, ", lba3: %u", EXTRACT_U_1(cp)));
        cp += 1;
        /* lba4 */
        ND_TCHECK_1(cp);
-       ND_PRINT((ndo, ", lba4: %u", *cp));
+       ND_PRINT((ndo, ", lba4: %u", EXTRACT_U_1(cp)));
        cp += 1;
        /* lba5 */
        ND_TCHECK_1(cp);
-       ND_PRINT((ndo, ", lba5: %u", *cp));
+       ND_PRINT((ndo, ", lba5: %u", EXTRACT_U_1(cp)));
        cp += 1;
        /* Reserved */
        ND_TCHECK_2(cp);
@@ -222,7 +222,7 @@ aoev1_query_print(netdissect_options *ndo,
        cp += 2;
        /* Sector Count */
        ND_TCHECK_1(cp);
-       ND_PRINT((ndo, ", Sector Count: %u", *cp));
+       ND_PRINT((ndo, ", Sector Count: %u", EXTRACT_U_1(cp)));
        cp += 1;
        /* AoE/CCmd */
        ND_TCHECK_1(cp);
@@ -366,7 +366,7 @@ aoev1_print(netdissect_options *ndo,
        cp += 2;
        /* Minor */
        ND_TCHECK_1(cp);
-       ND_PRINT((ndo, ", Minor: 0x%02x", *cp));
+       ND_PRINT((ndo, ", Minor: 0x%02x", EXTRACT_U_1(cp)));
        cp += 1;
        /* Command */
        ND_TCHECK_1(cp);
index feea837eac145c957fe79fb8c82199e26111401a..c408ac310cf42a7218744ace6cbc2946527b9ed7 100644 (file)
@@ -191,7 +191,7 @@ auth_print(netdissect_options *ndo, register const u_char *pptr)
                  bfd_auth_header->auth_type,
                  bfd_auth_header->auth_len));
                 pptr += 2;
-                ND_PRINT((ndo, "\n\t  Auth Key ID: %d", *pptr));
+                ND_PRINT((ndo, "\n\t  Auth Key ID: %d", EXTRACT_U_1(pptr)));
 
         switch(bfd_auth_header->auth_type) {
             case AUTH_PASSWORD:
index fcdd63dc20ed6e07dc28dc2307eb808862e71988..908f55f406daa84ee711615e4fb141106064b3fb 100644 (file)
@@ -202,7 +202,7 @@ cdp_print(netdissect_options *ndo,
                    case 0x0b: /* Duplex - CDPv2 */
                        if (len < 1)
                            goto trunc;
-                       ND_PRINT((ndo, "%s", *(tptr) ? "full": "half"));
+                       ND_PRINT((ndo, "%s", EXTRACT_U_1(tptr) ? "full": "half"));
                        break;
 
                    /* http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cata/186/2_12_m/english/release/notes/186rn21m.html
@@ -224,12 +224,12 @@ cdp_print(netdissect_options *ndo,
                    case 0x12: /* AVVID trust bitmap - not documented */
                        if (len < 1)
                            goto trunc;
-                       ND_PRINT((ndo, "0x%02x", *(tptr)));
+                       ND_PRINT((ndo, "0x%02x", EXTRACT_U_1(tptr)));
                        break;
                    case 0x13: /* AVVID untrusted port CoS - not documented */
                        if (len < 1)
                            goto trunc;
-                       ND_PRINT((ndo, "0x%02x", *(tptr)));
+                       ND_PRINT((ndo, "0x%02x", EXTRACT_U_1(tptr)));
                        break;
                    case 0x14: /* System Name - not documented */
                        ND_PRINT((ndo, "'"));
@@ -243,7 +243,7 @@ cdp_print(netdissect_options *ndo,
                    case 0x17: /* Physical Location - not documented */
                        if (len < 1)
                            goto trunc;
-                       ND_PRINT((ndo, "0x%02x", *(tptr)));
+                       ND_PRINT((ndo, "0x%02x", EXTRACT_U_1(tptr)));
                        if (len > 1) {
                                ND_PRINT((ndo, "/"));
                                (void)fn_printn(ndo, tptr + 1, len - 1, NULL);
index 2f570324eaf8f41341de19c9c6b8999f3d791933..2a2485e96d7d7f69fe1227a89ab31c0b583c2d0b 100644 (file)
@@ -588,7 +588,7 @@ cfm_print(netdissect_options *ndo,
             ND_PRINT((ndo, ", Vendor: %s (%u), Sub-Type %u",
                    tok2str(oui_values,"Unknown", EXTRACT_BE_U_3(tptr)),
                    EXTRACT_BE_U_3(tptr),
-                   *(tptr + 3)));
+                   EXTRACT_U_1(tptr + 3)));
             hexdump = TRUE;
             break;
 
index 118476cd6b923c1190f1c8f10cd274e881b165d3..3c6435bada4ef5c3772d5f19b5fb68b622654973 100644 (file)
@@ -542,7 +542,7 @@ static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_in
                optlen = EXTRACT_U_1(option + 1);
                if (optlen < 2) {
                        if (*option >= 128)
-                               ND_PRINT((ndo, "CCID option %u optlen too short", *option));
+                               ND_PRINT((ndo, "CCID option %u optlen too short", EXTRACT_U_1(option)));
                        else
                                ND_PRINT((ndo, "%s optlen too short",
                                          tok2str(dccp_option_values, "Option %u", EXTRACT_U_1(option))));
@@ -554,7 +554,7 @@ static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_in
        if (hlen < optlen) {
                if (*option >= 128)
                        ND_PRINT((ndo, "CCID option %u optlen goes past header length",
-                                 *option));
+                                 EXTRACT_U_1(option)));
                else
                        ND_PRINT((ndo, "%s optlen goes past header length",
                                  tok2str(dccp_option_values, "Option %u", EXTRACT_U_1(option))));
@@ -563,7 +563,7 @@ static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_in
        ND_TCHECK2(*option, optlen);
 
        if (*option >= 128) {
-               ND_PRINT((ndo, "CCID option %d", *option));
+               ND_PRINT((ndo, "CCID option %d", EXTRACT_U_1(option)));
                switch (optlen) {
                        case 4:
                                ND_PRINT((ndo, " %u", EXTRACT_BE_U_2(option + 2)));
index ee39c436e72b4d11bcb93b80fe3e397312099334..e150116d84eb8583e346fe08a1757c5dd6e490bf 100644 (file)
@@ -105,7 +105,7 @@ blabel_print(netdissect_options *ndo,
        ND_PRINT((ndo, "\\[x"));
        for (bitp = cp + 1, b = bitlen; bitp < lim && b > 7; b -= 8, bitp++) {
                ND_TCHECK(*bitp);
-               ND_PRINT((ndo, "%02x", *bitp));
+               ND_PRINT((ndo, "%02x", EXTRACT_U_1(bitp)));
        }
        if (b > 4) {
                ND_TCHECK(*bitp);
index 0f2c179e3d277f889731df8fe39b7367d097a867..8ec0658415a193041ac9a57adfe04bc97232f6ec 100644 (file)
@@ -678,7 +678,7 @@ isoclns_print(netdissect_options *ndo, const uint8_t *p, u_int length)
        }
 
        if (ndo->ndo_eflag)
-               ND_PRINT((ndo, "OSI NLPID %s (0x%02x): ", tok2str(nlpid_values, "Unknown", EXTRACT_U_1(p)), *p));
+               ND_PRINT((ndo, "OSI NLPID %s (0x%02x): ", tok2str(nlpid_values, "Unknown", EXTRACT_U_1(p)), EXTRACT_U_1(p)));
 
        switch (*p) {
 
@@ -718,7 +718,7 @@ isoclns_print(netdissect_options *ndo, const uint8_t *p, u_int length)
 
        default:
                if (!ndo->ndo_eflag)
-                       ND_PRINT((ndo, "OSI NLPID 0x%02x unknown", *p));
+                       ND_PRINT((ndo, "OSI NLPID 0x%02x unknown", EXTRACT_U_1(p)));
                ND_PRINT((ndo, "%slength: %u", ndo->ndo_eflag ? "" : ", ", length));
                if (length > 1)
                        print_unknown_data(ndo, p, "\n\t", length);
index 9fd7098b05c35fea6b9725bd442ade5ff7023b99..6fa25acaffc02b321aff7851801449fab60055ff 100644 (file)
@@ -211,7 +211,7 @@ krb4_print(netdissect_options *ndo,
                ND_PRINT((ndo, " (%d)", EXTRACT_U_1(cp)));
                cp++;
                ND_TCHECK(*cp);
-               ND_PRINT((ndo, " (%d)", *cp));
+               ND_PRINT((ndo, " (%d)", EXTRACT_U_1(cp)));
                break;
 
        case AUTH_MSG_KDC_REPLY:
index e8394937dcce7b9cb140c7d961913419b60137c3..c3bd4bc4b501a1c6a17097cbe54dcae97b43b59a 100644 (file)
@@ -1209,7 +1209,7 @@ lldp_private_dcbx_print(netdissect_options *ndo,
             }
            ND_PRINT((ndo, "\n\t    Control - Protocol Control (type 0x%x, length %d)",
                LLDP_DCBX_CONTROL_TLV, tlv_len));
-           ND_PRINT((ndo, "\n\t      Oper_Version: %d", *tptr));
+           ND_PRINT((ndo, "\n\t      Oper_Version: %d", EXTRACT_U_1(tptr)));
            ND_PRINT((ndo, "\n\t      Max_Version: %d", EXTRACT_U_1(tptr + 1)));
            ND_PRINT((ndo, "\n\t      Sequence Number: %d", EXTRACT_BE_U_4(tptr + 2)));
            ND_PRINT((ndo, "\n\t      Acknowledgement Number: %d",
@@ -1221,7 +1221,7 @@ lldp_private_dcbx_print(netdissect_options *ndo,
             }
            ND_PRINT((ndo, "\n\t    Feature - Priority Group (type 0x%x, length %d)",
                LLDP_DCBX_PRIORITY_GROUPS_TLV, tlv_len));
-           ND_PRINT((ndo, "\n\t      Oper_Version: %d", *tptr));
+           ND_PRINT((ndo, "\n\t      Oper_Version: %d", EXTRACT_U_1(tptr)));
            ND_PRINT((ndo, "\n\t      Max_Version: %d", EXTRACT_U_1(tptr + 1)));
            ND_PRINT((ndo, "\n\t      Info block(0x%02X): ", EXTRACT_U_1(tptr + 2)));
            tval = EXTRACT_U_1(tptr + 2);
@@ -1252,7 +1252,7 @@ lldp_private_dcbx_print(netdissect_options *ndo,
            ND_PRINT((ndo, "\n\t    Feature - Priority Flow Control"));
            ND_PRINT((ndo, " (type 0x%x, length %d)",
                LLDP_DCBX_PRIORITY_FLOW_CONTROL_TLV, tlv_len));
-           ND_PRINT((ndo, "\n\t      Oper_Version: %d", *tptr));
+           ND_PRINT((ndo, "\n\t      Oper_Version: %d", EXTRACT_U_1(tptr)));
            ND_PRINT((ndo, "\n\t      Max_Version: %d", EXTRACT_U_1(tptr + 1)));
            ND_PRINT((ndo, "\n\t      Info block(0x%02X): ", EXTRACT_U_1(tptr + 2)));
            tval = EXTRACT_U_1(tptr + 2);
@@ -1273,7 +1273,7 @@ lldp_private_dcbx_print(netdissect_options *ndo,
             }
            ND_PRINT((ndo, "\n\t    Feature - Application (type 0x%x, length %d)",
                LLDP_DCBX_APPLICATION_TLV, tlv_len));
-           ND_PRINT((ndo, "\n\t      Oper_Version: %d", *tptr));
+           ND_PRINT((ndo, "\n\t      Oper_Version: %d", EXTRACT_U_1(tptr)));
            ND_PRINT((ndo, "\n\t      Max_Version: %d", EXTRACT_U_1(tptr + 1)));
            ND_PRINT((ndo, "\n\t      Info block(0x%02X): ", EXTRACT_U_1(tptr + 2)));
            tval = EXTRACT_U_1(tptr + 2);
index 91416876454ab025c86dab8a440ea716ea81d2bf..59a0a092ff8ddf95ada47ad3525ce03e30d0548b 100644 (file)
@@ -60,7 +60,7 @@ msdp_print(netdissect_options *ndo, const u_char *sp, u_int length)
                        else
                                ND_PRINT((ndo, " SA-Response"));
                        ND_TCHECK(*sp);
-                       ND_PRINT((ndo, " %u entries", *sp));
+                       ND_PRINT((ndo, " %u entries", EXTRACT_U_1(sp)));
                        if ((u_int)((*sp * 12) + 8) < len) {
                                ND_PRINT((ndo, " [w/data]"));
                                if (ndo->ndo_vflag > 1) {
index ed95be8ecf273890e2b9e216f500c8dd6f7c52d4..731f0e38ac77a1ab2c1cb3e37769ae2b17a68e6c 100644 (file)
@@ -784,7 +784,7 @@ of10_bsn_message_print(netdissect_options *ndo,
                        goto invalid;
                /* index */
                ND_TCHECK_1(cp);
-               ND_PRINT((ndo, ", index %u", *cp));
+               ND_PRINT((ndo, ", index %u", EXTRACT_U_1(cp)));
                cp += 1;
                /* pad */
                ND_TCHECK_7(cp);
@@ -808,7 +808,7 @@ of10_bsn_message_print(netdissect_options *ndo,
                        goto invalid;
                /* index */
                ND_TCHECK_1(cp);
-               ND_PRINT((ndo, ", index %u", *cp));
+               ND_PRINT((ndo, ", index %u", EXTRACT_U_1(cp)));
                cp += 1;
                /* pad */
                ND_TCHECK_3(cp);
@@ -1396,7 +1396,7 @@ of10_match_print(netdissect_options *ndo,
        /* nw_tos */
        ND_TCHECK_1(cp);
        if (! (wildcards & OFPFW_NW_TOS))
-               ND_PRINT((ndo, "%smatch nw_tos 0x%02x", pfx, *cp));
+               ND_PRINT((ndo, "%smatch nw_tos 0x%02x", pfx, EXTRACT_U_1(cp)));
        cp += 1;
        /* nw_proto */
        ND_TCHECK_1(cp);
@@ -1560,7 +1560,7 @@ of10_actions_print(netdissect_options *ndo,
                case OFPAT_SET_NW_TOS:
                        /* nw_tos */
                        ND_TCHECK_1(cp);
-                       ND_PRINT((ndo, ", nw_tos 0x%02x", *cp));
+                       ND_PRINT((ndo, ", nw_tos 0x%02x", EXTRACT_U_1(cp)));
                        cp += 1;
                        /* pad */
                        ND_TCHECK_3(cp);
@@ -1628,7 +1628,7 @@ of10_features_reply_print(netdissect_options *ndo,
        cp += 4;
        /* n_tables */
        ND_TCHECK_1(cp);
-       ND_PRINT((ndo, ", n_tables %u", *cp));
+       ND_PRINT((ndo, ", n_tables %u", EXTRACT_U_1(cp)));
        cp += 1;
        /* pad */
        ND_TCHECK_3(cp);
index aaaecf0e0561e91cbfd13e120aaf95aa56e0afd4..37e829e3df91c1e9c232180716780455f17ba359 100644 (file)
@@ -231,7 +231,7 @@ ospf_print_grace_lsa(netdissect_options *ndo,
             }
             ND_PRINT((ndo, "%s (%u)",
                    tok2str(lsa_opaque_grace_tlv_reason_values, "Unknown", EXTRACT_U_1(tptr)),
-                   *tptr));
+                   EXTRACT_U_1(tptr)));
             break;
 
         case LS_OPAQUE_GRACE_TLV_INT_ADDRESS:
@@ -383,7 +383,7 @@ ospf_print_te_lsa(netdissect_options *ndo,
                    /* BC Model Id (1 octet) + Reserved (3 octets) */
                     ND_PRINT((ndo, "\n\t\tBandwidth Constraints Model ID: %s (%u)",
                            tok2str(diffserv_te_bc_values, "unknown", EXTRACT_U_1(tptr)),
-                           *tptr));
+                           EXTRACT_U_1(tptr)));
                    if (subtlv_length % 4 != 0) {
                        ND_PRINT((ndo, "\n\t\tlength %u != N x 4", subtlv_length));
                        goto invalid;
@@ -440,7 +440,7 @@ ospf_print_te_lsa(netdissect_options *ndo,
                    }
                     ND_PRINT((ndo, ", %s (%u)",
                            tok2str(lsa_opaque_te_tlv_link_type_sub_tlv_values,"unknown",EXTRACT_U_1(tptr)),
-                           *tptr));
+                           EXTRACT_U_1(tptr)));
                     break;
 
                 case LS_OPAQUE_TE_LINK_SUBTLV_SHARED_RISK_GROUP:
index 95b5b5c4a03b23a9c3bd60ff09169fa23bf3cc25..ac24845034f346e34c4037b0aa6a4d6d0ca13af7 100644 (file)
@@ -824,7 +824,7 @@ pimv2_print(netdissect_options *ndo,
                                if (olen != 4) {
                                        ND_PRINT((ndo, "ERROR: Option Length != 4 Bytes (%u)", olen));
                                } else {
-                                       ND_PRINT((ndo, "v%d", *bp));
+                                       ND_PRINT((ndo, "v%d", EXTRACT_U_1(bp)));
                                        if (*(bp+1) != 0) {
                                                ND_PRINT((ndo, ", interval "));
                                                unsigned_relts_print(ndo, *(bp+1));
index 74ebcbc7ae4c503f5ea52178284f9a6bb246ce01..39d41700cc7693e80e7e13f23cceda73c8ba7c95 100644 (file)
@@ -175,7 +175,7 @@ pppoe_print(netdissect_options *ndo, register const u_char *bp, u_int length)
                                        /* Print hex, not fast to abuse printf but this doesn't get used much */
                                        ND_PRINT((ndo, " [%s 0x", tok2str(pppoetag2str, "TAG-0x%x", tag_type)));
                                        for (v=p; v<p+tag_len; v++) {
-                                               ND_PRINT((ndo, "%02X", *v));
+                                               ND_PRINT((ndo, "%02X", EXTRACT_U_1(v)));
                                        }
                                        ND_PRINT((ndo, "]"));
                                }
index a342237018c0e6e996b447cfce0dff8f36c78bac..9049384fb9c70426145275d41c9c25fb2f92c870 100644 (file)
@@ -336,7 +336,7 @@ static void
 pptp_err_code_print(netdissect_options *ndo,
                     const uint8_t *err_code)
 {
-       ND_PRINT((ndo, " ERR_CODE(%u", *err_code));
+       ND_PRINT((ndo, " ERR_CODE(%u", EXTRACT_U_1(err_code)));
        if (ndo->ndo_vflag) {
                ND_PRINT((ndo, ":%s", tok2str(pptp_errcode_str, "?", EXTRACT_U_1(err_code))));
        }
@@ -482,7 +482,7 @@ static void
 pptp_result_code_print(netdissect_options *ndo,
                        const uint8_t *result_code, int ctrl_msg_type)
 {
-       ND_PRINT((ndo, " RESULT_CODE(%u", *result_code));
+       ND_PRINT((ndo, " RESULT_CODE(%u", EXTRACT_U_1(result_code)));
        if (ndo->ndo_vflag) {
                const struct tok *dict =
                        ctrl_msg_type == PPTP_CTRL_MSG_TYPE_SCCRP    ? pptp_scrrp_str :
index d517e0c4576a6a0769a32a760ed2d4f984a023d5..63d66242b9863dcec76835dedeb4fee9335a5aa9 100644 (file)
@@ -594,7 +594,7 @@ print_attr_string(netdissect_options *ndo,
            if (length < 3)
               goto trunc;
            if (*data && (*data <=0x1F) )
-              ND_PRINT((ndo, "Tag[%u] ", *data));
+              ND_PRINT((ndo, "Tag[%u] ", EXTRACT_U_1(data)));
            else
               ND_PRINT((ndo, "Tag[Unused] "));
            data++;
@@ -614,7 +614,7 @@ print_attr_string(netdissect_options *ndo,
               if (length < 1)
                  goto trunc;
               if (*data)
-                ND_PRINT((ndo, "Tag[%u] ", *data));
+                ND_PRINT((ndo, "Tag[%u] ", EXTRACT_U_1(data)));
               else
                 ND_PRINT((ndo, "Tag[Unused] "));
               data++;
@@ -626,14 +626,14 @@ print_attr_string(netdissect_options *ndo,
               goto trunc;
            ND_PRINT((ndo, "%s (0x%02x) ",
                   tok2str(rfc4675_tagged,"Unknown tag",EXTRACT_U_1(data)),
-                  *data));
+                  EXTRACT_U_1(data)));
            data++;
            length--;
         break;
    }
 
    for (i=0; i < length && EXTRACT_U_1(data); i++, data++)
-       ND_PRINT((ndo, "%c", (*data < 32 || *data > 126) ? '.' : *data));
+       ND_PRINT((ndo, "%c", (EXTRACT_U_1(data) < 32 || EXTRACT_U_1(data) > 126) ? '.' : EXTRACT_U_1(data)));
 
    return;
 
@@ -693,7 +693,7 @@ print_vendor_attr(netdissect_options *ndo,
                vendor_type,
                vendor_length));
         for (idx = 0; idx < vendor_length ; idx++, data++)
-            ND_PRINT((ndo, "%c", (*data < 32 || *data > 126) ? '.' : *data));
+            ND_PRINT((ndo, "%c", (EXTRACT_U_1(data) < 32 || EXTRACT_U_1(data) > 126) ? '.' : EXTRACT_U_1(data)));
         length-=vendor_length;
     }
     return;
@@ -734,7 +734,7 @@ print_attr_num(netdissect_options *ndo,
          if (!*data)
             ND_PRINT((ndo, "Tag[Unused] "));
          else
-            ND_PRINT((ndo, "Tag[%d] ", *data));
+            ND_PRINT((ndo, "Tag[%d] ", EXTRACT_U_1(data)));
          data++;
          data_value = EXTRACT_BE_U_3(data);
       }
@@ -796,7 +796,7 @@ print_attr_num(netdissect_options *ndo,
 
         case TUNNEL_PREFERENCE:
             if (*data)
-               ND_PRINT((ndo, "Tag[%d] ", *data));
+               ND_PRINT((ndo, "Tag[%d] ", EXTRACT_U_1(data)));
             else
                ND_PRINT((ndo, "Tag[Unused] "));
             data++;
@@ -806,7 +806,7 @@ print_attr_num(netdissect_options *ndo,
         case EGRESS_VLAN_ID:
             ND_PRINT((ndo, "%s (0x%02x) ",
                    tok2str(rfc4675_tagged,"Unknown tag",EXTRACT_U_1(data)),
-                   *data));
+                   EXTRACT_U_1(data)));
             data++;
             ND_PRINT((ndo, "%d", EXTRACT_BE_U_3(data)));
           break;
@@ -1008,7 +1008,7 @@ print_attr_strange(netdissect_options *ndo,
               ND_PRINT((ndo, "User cannot change password"));
            data++;
            ND_TCHECK_1(data);
-           ND_PRINT((ndo, ", Min password length: %d", *data));
+           ND_PRINT((ndo, ", Min password length: %d", EXTRACT_U_1(data)));
            data++;
            ND_PRINT((ndo, ", created at: "));
            ND_TCHECK_4(data);
index 4a289af5ced6322d972314fb367b9e18d8c12fff..89ca887d53909e3c56b21db57c8ea8dd4a241562 100644 (file)
@@ -138,7 +138,8 @@ rip_entry_print_v2(netdissect_options *ndo,
                        u_int i = 0;
                        ND_PRINT((ndo, "\n\t  Simple Text Authentication data: "));
                        for (; i < RIP_AUTHLEN; p++, i++)
-                               ND_PRINT((ndo, "%c", ND_ISPRINT(*p) ? *p : '.'));
+                               ND_PRINT((ndo, "%c",
+                                        ND_ISPRINT(*p) ? EXTRACT_U_1(p) : '.'));
                } else if (auth_type == 3) {
                        ND_PRINT((ndo, "\n\t  Auth header:"));
                        ND_PRINT((ndo, " Packet Len %u,", EXTRACT_BE_U_2((const uint8_t *)ni + 4)));
index 2c950fbad6eb627d75b6d55b9097848d7478d0a5..1af8e863794a53fce7798f5295f9693926d9f67e 100644 (file)
@@ -190,7 +190,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len
         * version 0, there is no way to know exactly how to skip the
         * current PDU.
         */
-       ND_PRINT((ndo, "%sRPKI-RTRv%u (unknown)", indent_string(8), *tptr));
+       ND_PRINT((ndo, "%sRPKI-RTRv%u (unknown)", indent_string(8), EXTRACT_U_1(tptr)));
        return len;
     }
     if (len < sizeof(rpki_rtr_pdu)) {
index 99df847665bd0723346b022f9a38425f5cf777dd..b9490f288d6a1ce7bc059f692e075c5837efdd3e 100644 (file)
@@ -682,7 +682,7 @@ asn1_print_octets(netdissect_options *ndo, struct be *elem)
 
        ND_TCHECK2(*p, asnlen);
        for (i = asnlen; i-- > 0; p++)
-               ND_PRINT((ndo, "_%.2x", *p));
+               ND_PRINT((ndo, "_%.2x", EXTRACT_U_1(p)));
        return 0;
 
 trunc:
@@ -712,7 +712,7 @@ asn1_print_string(netdissect_options *ndo, struct be *elem)
                ND_PRINT((ndo, "\""));
        } else {
                for (i = asnlen; i-- > 0; p++) {
-                       ND_PRINT((ndo, first ? "%.2x" : "_%.2x", *p));
+                       ND_PRINT((ndo, first ? "%.2x" : "_%.2x", EXTRACT_U_1(p)));
                        first = 0;
                }
        }
@@ -825,7 +825,7 @@ asn1_print(netdissect_options *ndo,
                p = (const u_char *)elem->data.raw;
                ND_TCHECK2(*p, asnlen);
                for (i = asnlen; i-- != 0; p++) {
-                       ND_PRINT((ndo, (i == asnlen-1) ? "%u" : ".%u", *p));
+                       ND_PRINT((ndo, (i == asnlen-1) ? "%u" : ".%u", EXTRACT_U_1(p)));
                }
                break;
 
index 59e343aec10c53e7ab9a79a0b8bb671d74ec811c..716642360001c24dbfcbcb655ff41ae43c807fd3 100644 (file)
@@ -461,7 +461,7 @@ tcp_print(netdissect_options *ndo,
                         case TCPOPT_WSCALE:
                                 datalen = 1;
                                 LENCHECK(datalen);
-                                ND_PRINT((ndo, " %u", *cp));
+                                ND_PRINT((ndo, " %u", EXTRACT_U_1(cp)));
                                 break;
 
                         case TCPOPT_SACK:
index 748016c6336235bc14844cfb9b2038fa22f47475..94c325667699b792f59fee37123e3cdf5ecb10f7 100644 (file)
@@ -166,7 +166,7 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length)
         case UDLD_TIMEOUT_INTERVAL_TLV:
             if (len != 1)
                 goto invalid;
-            ND_PRINT((ndo, ", %us", (*tptr)));
+            ND_PRINT((ndo, ", %us", (EXTRACT_U_1(tptr))));
             break;
 
         case UDLD_SEQ_NUMBER_TLV:
index 7b89e0297db87e8ecc5a7ec5f3ee2f5c81d22487..04054112faf8d202363145de6950e9be62583a3a 100644 (file)
@@ -132,7 +132,7 @@ vtp_print (netdissect_options *ndo,
 
     type = EXTRACT_U_1(tptr + 1);
     ND_PRINT((ndo, "VTPv%u, Message %s (0x%02x), length %u",
-          *tptr,
+          EXTRACT_U_1(tptr),
           tok2str(vtp_message_type_values,"Unknown message type", type),
           type,
           length));
index c6c065243217abdab55451570aef6d1d92d69855..c60d408afaf8b09c637889a69fd6fdc943cfdf89 100644 (file)
--- a/smbutil.c
+++ b/smbutil.c
@@ -637,7 +637,7 @@ smb_fdata1(netdissect_options *ndo,
 
            ND_TCHECK(*buf);
            if (*buf != 4 && *buf != 2) {
-               ND_PRINT((ndo, "Error! ASCIIZ buffer of type %u", *buf));
+               ND_PRINT((ndo, "Error! ASCIIZ buffer of type %u", EXTRACT_U_1(buf)));
                return maxbuf;  /* give up */
            }
            len = 0;