]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use more the EXTRACT_U_1() macro (29/n)
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 26 Nov 2017 20:33:24 +0000 (21:33 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 26 Nov 2017 20:33:24 +0000 (21:33 +0100)
In ND_PRINT() macro call(s) (step 8).

*(p + e)

print-ahcp.c
print-bgp.c
print-cdp.c
print-dccp.c
print-dtp.c
print-eap.c
print-lldp.c
print-rrcp.c
print-rsvp.c
print-slow.c
print-vtp.c

index f12e5cf9baaa6146289fe8014c9321e729f83ac2..2ef41618a62b6fe98efe26d58c3acc704ac8f127 100644 (file)
@@ -200,7 +200,7 @@ ahcp_ipv6_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char
                if (cp + 17 > ep)
                        goto invalid;
                ND_TCHECK2(*cp, 17);
-               ND_PRINT((ndo, "%s%s/%u", sep, ip6addr_string(ndo, cp), *(cp + 16)));
+               ND_PRINT((ndo, "%s%s/%u", sep, ip6addr_string(ndo, cp), EXTRACT_U_1(cp + 16)));
                cp += 17;
                sep = ", ";
        }
@@ -224,7 +224,7 @@ ahcp_ipv4_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char
                if (cp + 5 > ep)
                        goto invalid;
                ND_TCHECK_5(cp);
-               ND_PRINT((ndo, "%s%s/%u", sep, ipaddr_string(ndo, cp), *(cp + 4)));
+               ND_PRINT((ndo, "%s%s/%u", sep, ipaddr_string(ndo, cp), EXTRACT_U_1(cp + 4)));
                cp += 5;
                sep = ", ";
        }
index a4cf664b496acb4790af3b0b23b54d7d4a3f07f7..478bd55d664d77d250876585108a042c11aba2ae 100644 (file)
@@ -2119,8 +2119,8 @@ bgp_attr_print(netdissect_options *ndo,
                                tok2str(bgp_extd_comm_ospf_rtype_values,
                                          "unknown (0x%02x)",
                                          EXTRACT_U_1((tptr + 6))),
-                               (*(tptr+7) &  BGP_OSPF_RTYPE_METRIC_TYPE) ? "E2" : "",
-                               ((*(tptr+6) == BGP_OSPF_RTYPE_EXT) || (*(tptr+6) == BGP_OSPF_RTYPE_NSSA)) ? "E1" : ""));
+                               (EXTRACT_U_1(tptr + 7) &  BGP_OSPF_RTYPE_METRIC_TYPE) ? "E2" : "",
+                               ((EXTRACT_U_1(tptr + 6) == BGP_OSPF_RTYPE_EXT) || (EXTRACT_U_1(tptr + 6) == BGP_OSPF_RTYPE_NSSA)) ? "E1" : ""));
                         break;
                     case BGP_EXT_COM_L2INFO:
                         ND_PRINT((ndo, ": %s Control Flags [0x%02x]:MTU %u",
index 77c51358f26313f3eeeb5ef88e8d66a9be3db2ab..fcdd63dc20ed6e07dc28dc2307eb808862e71988 100644 (file)
@@ -106,7 +106,7 @@ cdp_print(netdissect_options *ndo,
 
        ND_TCHECK2(*tptr, CDP_HEADER_LEN);
        ND_PRINT((ndo, "CDPv%u, ttl: %us", EXTRACT_U_1((tptr + CDP_HEADER_VERSION_OFFSET)),
-                                          *(tptr + CDP_HEADER_TTL_OFFSET)));
+                                          EXTRACT_U_1(tptr + CDP_HEADER_TTL_OFFSET)));
        if (ndo->ndo_vflag)
                ND_PRINT((ndo, ", checksum: 0x%04x (unverified), length %u", EXTRACT_BE_U_2(tptr + CDP_HEADER_CHECKSUM_OFFSET), length));
        tptr += CDP_HEADER_LEN;
index e351aeb802202df43fa47fb09d3014281db167d0..118476cd6b923c1190f1c8f10cd274e881b165d3 100644 (file)
@@ -586,41 +586,41 @@ static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_in
                                return optlen;
                        }
                        if (*(option + 2) < 10){
-                               ND_PRINT((ndo, " %s", dccp_feature_nums[*(option + 2)]));
+                               ND_PRINT((ndo, " %s", dccp_feature_nums[EXTRACT_U_1(option + 2)]));
                                for (i = 0; i < optlen - 3; i++)
-                                       ND_PRINT((ndo, " %d", *(option + 3 + i)));
+                                       ND_PRINT((ndo, " %d", EXTRACT_U_1(option + 3 + i)));
                        }
                        break;
                case 36:
                        if (optlen > 2) {
                                ND_PRINT((ndo, " 0x"));
                                for (i = 0; i < optlen - 2; i++)
-                                       ND_PRINT((ndo, "%02x", *(option + 2 + i)));
+                                       ND_PRINT((ndo, "%02x", EXTRACT_U_1(option + 2 + i)));
                        }
                        break;
                case 37:
                        for (i = 0; i < optlen - 2; i++)
-                               ND_PRINT((ndo, " %d", *(option + 2 + i)));
+                               ND_PRINT((ndo, " %d", EXTRACT_U_1(option + 2 + i)));
                        break;
                case 38:
                        if (optlen > 2) {
                                ND_PRINT((ndo, " 0x"));
                                for (i = 0; i < optlen - 2; i++)
-                                       ND_PRINT((ndo, "%02x", *(option + 2 + i)));
+                                       ND_PRINT((ndo, "%02x", EXTRACT_U_1(option + 2 + i)));
                        }
                        break;
                case 39:
                        if (optlen > 2) {
                                ND_PRINT((ndo, " 0x"));
                                for (i = 0; i < optlen - 2; i++)
-                                       ND_PRINT((ndo, "%02x", *(option + 2 + i)));
+                                       ND_PRINT((ndo, "%02x", EXTRACT_U_1(option + 2 + i)));
                        }
                        break;
                case 40:
                        if (optlen > 2) {
                                ND_PRINT((ndo, " 0x"));
                                for (i = 0; i < optlen - 2; i++)
-                                       ND_PRINT((ndo, "%02x", *(option + 2 + i)));
+                                       ND_PRINT((ndo, "%02x", EXTRACT_U_1(option + 2 + i)));
                        }
                        break;
                case 41:
@@ -647,7 +647,7 @@ static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_in
                        if (optlen > 2) {
                                ND_PRINT((ndo, " "));
                                for (i = 0; i < optlen - 2; i++)
-                                       ND_PRINT((ndo, "%02x", *(option + 2 + i)));
+                                       ND_PRINT((ndo, "%02x", EXTRACT_U_1(option + 2 + i)));
                        }
                        break;
                }
index cd7a1845d63597f369accd0f20079268f305d6bc..4799f2607274440f0897cc8466e7ffd857d6ada2 100644 (file)
@@ -96,7 +96,7 @@ dtp_print (netdissect_options *ndo, const u_char *pptr, u_int length)
        case DTP_DTP_TYPE_TLV:
                 if (len < 5)
                     goto invalid;
-                ND_PRINT((ndo, ", 0x%x", *(tptr+4)));
+                ND_PRINT((ndo, ", 0x%x", EXTRACT_U_1(tptr + 4)));
                 break;
 
        case DTP_NEIGHBOR_TLV:
index 84bbe1b4efd139e8133a55e3ff908acf14744dcd..bfc678f57d31d326f159013f4f5fe682b6673741 100644 (file)
@@ -228,7 +228,7 @@ eap_print(netdissect_options *ndo,
                     ND_TCHECK_1(tptr + count);
                     ND_PRINT((ndo, " %s (%u),",
                            tok2str(eap_type_values, "unknown", EXTRACT_U_1((tptr + count))),
-                           *(tptr + count)));
+                           EXTRACT_U_1(tptr + count)));
                     count++;
                 }
                 break;
@@ -241,7 +241,7 @@ eap_print(netdissect_options *ndo,
                            EAP_TTLS_VERSION(EXTRACT_U_1((tptr + 5)))));
                 ND_PRINT((ndo, " flags [%s] 0x%02x,",
                        bittok2str(eap_tls_flags_values, "none", EXTRACT_U_1((tptr + 5))),
-                       *(tptr + 5)));
+                       EXTRACT_U_1(tptr + 5)));
 
                 if (EAP_TLS_EXTRACT_BIT_L(*(tptr+5))) {
                     ND_TCHECK_4(tptr + 6);
@@ -255,7 +255,7 @@ eap_print(netdissect_options *ndo,
                        EAP_TTLS_VERSION(EXTRACT_U_1((tptr + 5)))));
                 ND_PRINT((ndo, " flags [%s] 0x%02x,",
                        bittok2str(eap_tls_flags_values, "none", EXTRACT_U_1((tptr + 5))),
-                       *(tptr + 5)));
+                       EXTRACT_U_1(tptr + 5)));
 
                 if (EAP_TLS_EXTRACT_BIT_L(*(tptr+5))) {
                     ND_TCHECK_4(tptr + 6);
@@ -270,7 +270,7 @@ eap_print(netdissect_options *ndo,
                 ND_TCHECK_1(tptr + 5);
                 ND_PRINT((ndo, " subtype [%s] 0x%02x,",
                        tok2str(eap_aka_subtype_values, "unknown", EXTRACT_U_1((tptr + 5))),
-                       *(tptr + 5)));
+                       EXTRACT_U_1(tptr + 5)));
 
                 /* FIXME - TLV attributes follow */
                 break;
index 1d829ac80bcb7a02044fa2b4fb59a4a0bfaaca00..e8394937dcce7b9cb140c7d961913419b60137c3 100644 (file)
@@ -683,7 +683,7 @@ lldp_private_8021_print(netdissect_options *ndo,
         ND_PRINT((ndo, "\n\t    port and protocol vlan id (PPVID): %u, flags [%s] (0x%02x)",
                EXTRACT_BE_U_2(tptr + 5),
                bittok2str(lldp_8021_port_protocol_id_values, "none", EXTRACT_U_1((tptr + 4))),
-               *(tptr + 4)));
+               EXTRACT_U_1(tptr + 4)));
         break;
     case LLDP_PRIVATE_8021_SUBTYPE_VLAN_NAME:
         if (tlv_len < 6) {
@@ -752,7 +752,7 @@ lldp_private_8021_print(netdissect_options *ndo,
         if(tlv_len<LLDP_PRIVATE_8021_SUBTYPE_ETS_RECOMMENDATION_LENGTH) {
                return hexdump;
         }
-        ND_PRINT((ndo, "\n\t    RES: %d", *(tptr + 4)));
+        ND_PRINT((ndo, "\n\t    RES: %d", EXTRACT_U_1(tptr + 4)));
         /*Print Priority Assignment Table */
         print_ets_priority_assignment_table(ndo, tptr + 5);
         /*Print TC Bandwidth Table */
@@ -780,7 +780,7 @@ lldp_private_8021_print(netdissect_options *ndo,
         if(tlv_len<LLDP_PRIVATE_8021_SUBTYPE_APPLICATION_PRIORITY_MIN_LENGTH) {
             return hexdump;
         }
-        ND_PRINT((ndo, "\n\t    RES: %d", *(tptr + 4)));
+        ND_PRINT((ndo, "\n\t    RES: %d", EXTRACT_U_1(tptr + 4)));
         if(tlv_len<=LLDP_PRIVATE_8021_SUBTYPE_APPLICATION_PRIORITY_MIN_LENGTH){
                return hexdump;
         }
@@ -875,7 +875,7 @@ lldp_private_8023_print(netdissect_options *ndo,
         }
         ND_PRINT((ndo, "\n\t    autonegotiation [%s] (0x%02x)",
                bittok2str(lldp_8023_autonegotiation_values, "none", EXTRACT_U_1((tptr + 4))),
-               *(tptr + 4)));
+               EXTRACT_U_1(tptr + 4)));
         ND_PRINT((ndo, "\n\t    PMD autoneg capability [%s] (0x%04x)",
                bittok2str(lldp_pmd_capability_values,"unknown", EXTRACT_BE_U_2(tptr + 5)),
                EXTRACT_BE_U_2(tptr + 5)));
@@ -998,7 +998,7 @@ lldp_private_tia_print(netdissect_options *ndo,
                           EXTRACT_BE_U_2(tptr + 4)), EXTRACT_BE_U_2(tptr + 4)));
         ND_PRINT((ndo, "\n\t    Device type [%s] (0x%02x)",
                tok2str(lldp_tia_device_type_values, "unknown", EXTRACT_U_1((tptr + 6))),
-               *(tptr + 6)));
+               EXTRACT_U_1(tptr + 6)));
         break;
 
     case LLDP_PRIVATE_TIA_SUBTYPE_NETWORK_POLICY:
@@ -1007,7 +1007,7 @@ lldp_private_tia_print(netdissect_options *ndo,
         }
         ND_PRINT((ndo, "\n\t    Application type [%s] (0x%02x)",
                tok2str(lldp_tia_application_type_values, "none", EXTRACT_U_1((tptr + 4))),
-               *(tptr + 4)));
+               EXTRACT_U_1(tptr + 4)));
         ND_PRINT((ndo, ", Flags [%s]", bittok2str(
                    lldp_tia_network_policy_bits_values, "none", EXTRACT_U_1((tptr + 5)))));
         ND_PRINT((ndo, "\n\t    Vlan id %u",
@@ -1033,9 +1033,9 @@ lldp_private_tia_print(netdissect_options *ndo,
                 return hexdump;
             }
             ND_PRINT((ndo, "\n\t    Latitude resolution %u, latitude value %" PRIu64,
-                   (*(tptr + 5) >> 2), lldp_extract_latlon(tptr + 5)));
+                   (EXTRACT_U_1(tptr + 5) >> 2), lldp_extract_latlon(tptr + 5)));
             ND_PRINT((ndo, "\n\t    Longitude resolution %u, longitude value %" PRIu64,
-                   (*(tptr + 10) >> 2), lldp_extract_latlon(tptr + 10)));
+                   (EXTRACT_U_1(tptr + 10) >> 2), lldp_extract_latlon(tptr + 10)));
             ND_PRINT((ndo, "\n\t    Altitude type %s (%u)",
                    tok2str(lldp_tia_location_altitude_type_values, "unknown",EXTRACT_U_1((tptr + 15)) >> 4),
                    (EXTRACT_U_1(tptr + 15) >> 4)));
@@ -1044,7 +1044,7 @@ lldp_private_tia_print(netdissect_options *ndo,
                    ((EXTRACT_BE_U_4(tptr + 16) & 0x3fffffff))));
             ND_PRINT((ndo, "\n\t    Datum %s (0x%02x)",
                    tok2str(lldp_tia_location_datum_type_values, "unknown", EXTRACT_U_1((tptr + 20))),
-                   *(tptr + 20)));
+                   EXTRACT_U_1(tptr + 20)));
             break;
 
         case LLDP_TIA_LOCATION_DATA_FORMAT_CIVIC_ADDRESS:
@@ -1061,7 +1061,7 @@ lldp_private_tia_print(netdissect_options *ndo,
             ND_PRINT((ndo, "\n\t    LCI length %u, LCI what %s (0x%02x), Country-code ",
                    lci_len,
                    tok2str(lldp_tia_location_lci_what_values, "unknown", EXTRACT_U_1((tptr + 6))),
-                   *(tptr + 6)));
+                   EXTRACT_U_1(tptr + 6)));
 
             /* Country code */
             safeputs(ndo, tptr + 7, 2);
@@ -1114,7 +1114,7 @@ lldp_private_tia_print(netdissect_options *ndo,
             return hexdump;
         }
         ND_PRINT((ndo, "\n\t    Power type [%s]",
-               (*(tptr + 4) & 0xC0 >> 6) ? "PD device" : "PSE device"));
+               (EXTRACT_U_1(tptr + 4) & 0xC0 >> 6) ? "PD device" : "PSE device"));
         ND_PRINT((ndo, ", Power source [%s]",
                tok2str(lldp_tia_power_source_values, "none", (EXTRACT_U_1((tptr + 4)) & 0x30) >> 4)));
         ND_PRINT((ndo, "\n\t    Power priority [%s] (0x%02x)",
@@ -1210,7 +1210,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      Max_Version: %d", *(tptr + 1)));
+           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",
                                        EXTRACT_BE_U_4(tptr + 6)));
@@ -1222,13 +1222,13 @@ 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      Max_Version: %d", *(tptr + 1)));
-           ND_PRINT((ndo, "\n\t      Info block(0x%02X): ", *(tptr + 2)));
+           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);
            ND_PRINT((ndo, "Enable bit: %d, Willing bit: %d, Error Bit: %d",
                (tval &  0x80) ? 1 : 0, (tval &  0x40) ? 1 : 0,
                (tval &  0x20) ? 1 : 0));
-           ND_PRINT((ndo, "\n\t      SubType: %d", *(tptr + 3)));
+           ND_PRINT((ndo, "\n\t      SubType: %d", EXTRACT_U_1(tptr + 3)));
            ND_PRINT((ndo, "\n\t      Priority Allocation"));
 
            /*
@@ -1242,8 +1242,8 @@ lldp_private_dcbx_print(netdissect_options *ndo,
            }
            ND_PRINT((ndo, "\n\t      Priority Group Allocation"));
            for (i = 0; i <= 7; i++)
-               ND_PRINT((ndo, "\n\t          Pg percentage[%d]: %d", i, *(tptr + 8 + i)));
-           ND_PRINT((ndo, "\n\t      NumTCsSupported: %d", *(tptr + 8 + 8)));
+               ND_PRINT((ndo, "\n\t          Pg percentage[%d]: %d", i, EXTRACT_U_1(tptr + 8 + i)));
+           ND_PRINT((ndo, "\n\t      NumTCsSupported: %d", EXTRACT_U_1(tptr + 8 + 8)));
            break;
         case LLDP_DCBX_PRIORITY_FLOW_CONTROL_TLV:
             if (tlv_len < 6) {
@@ -1253,19 +1253,19 @@ lldp_private_dcbx_print(netdissect_options *ndo,
            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      Max_Version: %d", *(tptr + 1)));
-           ND_PRINT((ndo, "\n\t      Info block(0x%02X): ", *(tptr + 2)));
+           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);
            ND_PRINT((ndo, "Enable bit: %d, Willing bit: %d, Error Bit: %d",
                (tval &  0x80) ? 1 : 0, (tval &  0x40) ? 1 : 0,
                (tval &  0x20) ? 1 : 0));
-           ND_PRINT((ndo, "\n\t      SubType: %d", *(tptr + 3)));
+           ND_PRINT((ndo, "\n\t      SubType: %d", EXTRACT_U_1(tptr + 3)));
            tval = EXTRACT_U_1(tptr + 4);
-           ND_PRINT((ndo, "\n\t      PFC Config (0x%02X)", *(tptr + 4)));
+           ND_PRINT((ndo, "\n\t      PFC Config (0x%02X)", EXTRACT_U_1(tptr + 4)));
            for (i = 0; i <= 7; i++)
                ND_PRINT((ndo, "\n\t          Priority Bit %d: %s",
                    i, (tval & (1 << i)) ? "Enabled" : "Disabled"));
-           ND_PRINT((ndo, "\n\t      NumTCPFCSupported: %d", *(tptr + 5)));
+           ND_PRINT((ndo, "\n\t      NumTCPFCSupported: %d", EXTRACT_U_1(tptr + 5)));
            break;
         case LLDP_DCBX_APPLICATION_TLV:
             if (tlv_len < 4) {
@@ -1274,13 +1274,13 @@ 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      Max_Version: %d", *(tptr + 1)));
-           ND_PRINT((ndo, "\n\t      Info block(0x%02X): ", *(tptr + 2)));
+           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);
            ND_PRINT((ndo, "Enable bit: %d, Willing bit: %d, Error Bit: %d",
                (tval &  0x80) ? 1 : 0, (tval &  0x40) ? 1 : 0,
                (tval &  0x20) ? 1 : 0));
-           ND_PRINT((ndo, "\n\t      SubType: %d", *(tptr + 3)));
+           ND_PRINT((ndo, "\n\t      SubType: %d", EXTRACT_U_1(tptr + 3)));
            tval = tlv_len - 4;
            mptr = tptr + 4;
            while (tval >= 6) {
@@ -1292,7 +1292,7 @@ lldp_private_dcbx_print(netdissect_options *ndo,
                        (uval >> 22),
                        (uval >> 22) ? "Socket Number" : "L2 EtherType"));
                ND_PRINT((ndo, "\n\t          OUI: 0x%06x", uval & 0x3fffff));
-               ND_PRINT((ndo, "\n\t          User Priority Map: 0x%02x", *(mptr + 5)));
+               ND_PRINT((ndo, "\n\t          User Priority Map: 0x%02x", EXTRACT_U_1(mptr + 5)));
                tval = tval - 6;
                mptr = mptr + 6;
            }
index 0dbb6faffca8d7d14c7d80a965872d145c2f15aa..e57be39b2f7a7be0faa07485b792a2f3246cac74 100644 (file)
@@ -108,7 +108,7 @@ rrcp_print(netdissect_options *ndo,
        }
        ND_PRINT((ndo, "%s %s",
                tok2str(proto_values,"RRCP-0x%02x",rrcp_proto),
-               ((*(cp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_ISREPLY) ? "reply" : "query"));
+               ((EXTRACT_U_1(cp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_ISREPLY) ? "reply" : "query"));
        if (rrcp_proto==1){
            ND_PRINT((ndo, ": %s",
                     tok2str(opcode_values,"unknown opcode (0x%02x)",rrcp_opcode)));
@@ -128,8 +128,8 @@ rrcp_print(netdissect_options *ndo,
             ((*(cp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_ISREPLY)){
            ND_TCHECK_4(cp + RRCP_VENDOR_ID_OFFSET);
            ND_PRINT((ndo, " downlink_port=%d, uplink_port=%d, uplink_mac=%s, vendor_id=%08x ,chip_id=%04x ",
-                    *(cp + RRCP_DOWNLINK_PORT_OFFSET),
-                    *(cp + RRCP_UPLINK_PORT_OFFSET),
+                    EXTRACT_U_1(cp + RRCP_DOWNLINK_PORT_OFFSET),
+                    EXTRACT_U_1(cp + RRCP_UPLINK_PORT_OFFSET),
                     etheraddr_string(ndo, cp + RRCP_UPLINK_MAC_OFFSET),
                     EXTRACT_BE_U_4(cp + RRCP_VENDOR_ID_OFFSET),
                     EXTRACT_BE_U_2(cp + RRCP_CHIP_ID_OFFSET)));
index 8d82e3566f2f357c8e53ac6e11984fb88282ba58..5f895493872467462f00945af053de28b80f21b0 100644 (file)
@@ -507,7 +507,7 @@ rsvp_intserv_print(netdissect_options *ndo,
            tok2str(rsvp_intserv_parameter_id_values,"unknown",parameter_id),
            parameter_id,
            parameter_length,
-           *(tptr + 1)));
+           EXTRACT_U_1(tptr + 1)));
 
     if (obj_tlen < parameter_length+4)
         return 0;
index a4064ed4fbd827c11ca609f4e1e2425fedd38ca0..6f489ae251cae4f7d0b6eee3ba21cfaae6066ed2 100644 (file)
@@ -262,7 +262,7 @@ slow_print(netdissect_options *ndo,
             goto tooshort;
         ND_TCHECK(*(pptr+1));
         if (*(pptr+1) != LACP_VERSION) {
-            ND_PRINT((ndo, "LACP version %u packet not supported", *(pptr+1)));
+            ND_PRINT((ndo, "LACP version %u packet not supported", EXTRACT_U_1(pptr + 1)));
             return;
         }
         print_version = 1;
@@ -273,7 +273,7 @@ slow_print(netdissect_options *ndo,
             goto tooshort;
         ND_TCHECK(*(pptr+1));
         if (*(pptr+1) != MARKER_VERSION) {
-            ND_PRINT((ndo, "MARKER version %u packet not supported", *(pptr+1)));
+            ND_PRINT((ndo, "MARKER version %u packet not supported", EXTRACT_U_1(pptr + 1)));
             return;
         }
         print_version = 1;
index d10692da903eba10b9bfb03013300d50d642f095..7b89e0297db87e8ecc5a7ec5f3ee2f5c81d22487 100644 (file)
@@ -152,7 +152,7 @@ vtp_print (netdissect_options *ndo,
     fn_printzp(ndo, tptr + 4, mgmtd_len, NULL);
     ND_PRINT((ndo, ", %s: %u",
           tok2str(vtp_header_values, "Unknown", type),
-          *(tptr+2)));
+          EXTRACT_U_1(tptr + 2)));
 
     tptr += VTP_HEADER_LEN;