]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-openflow-1.0.c
Always define check_and_add_compiler_option().
[tcpdump] / print-openflow-1.0.c
index 12051992a5504c27896f2140a0a95c36ee4cec39..4cf766bc6cb6f14c615be0d47626a8fb09e6f516 100644 (file)
@@ -697,12 +697,11 @@ static const char *
 vlan_str(const uint16_t vid)
 {
        static char buf[sizeof("65535 (bogus)")];
-       const char *fmt;
 
        if (vid == OFP_VLAN_NONE)
                return "NONE";
-       fmt = (vid > 0 && vid < 0x0fff) ? "%u" : "%u (bogus)";
-       nd_snprintf(buf, sizeof(buf), fmt, vid);
+       snprintf(buf, sizeof(buf), "%u%s", vid,
+           (vid > 0 && vid < 0x0fff) ? "" : " (bogus)");
        return buf;
 }
 
@@ -710,7 +709,8 @@ static const char *
 pcp_str(const uint8_t pcp)
 {
        static char buf[sizeof("255 (bogus)")];
-       nd_snprintf(buf, sizeof(buf), pcp <= 7 ? "%u" : "%u (bogus)", pcp);
+       snprintf(buf, sizeof(buf), "%u%s", pcp,
+           pcp <= 7 ? "" : " (bogus)");
        return buf;
 }
 
@@ -1128,7 +1128,7 @@ of10_packet_data_print(netdissect_options *ndo,
        ND_TCHECK_LEN(cp, len);
        ndo->ndo_vflag -= 3;
        ND_PRINT(", frame decoding below\n");
-       ether_print(ndo, cp, len, ndo->ndo_snapend - cp, NULL, NULL);
+       ether_print(ndo, cp, len, ND_BYTES_AVAILABLE_AFTER(cp), NULL, NULL);
        ndo->ndo_vflag += 3;
        return cp + len;
 
@@ -1351,7 +1351,7 @@ of10_match_print(netdissect_options *ndo,
        uint32_t wildcards;
        uint16_t dl_type;
        uint8_t nw_proto;
-       u_char nw_bits;
+       u_int nw_bits;
        const char *field_name;
 
        /* wildcards */