]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Add more nd_print_trunc() calls
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 6 Jun 2018 13:00:10 +0000 (15:00 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 6 Jun 2018 16:12:42 +0000 (18:12 +0200)
Update the output of some tests accordingly.

12 files changed:
print-arcnet.c
print-atalk.c
print-ether.c
print-isakmp.c
print-ppp.c
print-sll.c
tests/heapoverflow-ppp_hdlc_if_print.out
tests/isakmp-3948-oobr-2.out
tests/isakmp-rfc3948-oobr.out
tests/l2tp-avp-overflow.out
tests/otv-heapoverflow-2.out
tests/pktap-heap-overflow.out

index 18d90aa9acd57e42827f645223d25b92403866a9..b5831c237579bf0f021d0c4e69cf05ba4a912af9 100644 (file)
@@ -192,7 +192,7 @@ arcnet_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ch
 
        ndo->ndo_protocol = "arcnet_if";
        if (caplen < ARC_HDRLEN || length < ARC_HDRLEN) {
-               ND_PRINT("[|arcnet]");
+               nd_print_trunc(ndo);
                return (caplen);
        }
 
@@ -280,7 +280,7 @@ arcnet_linux_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, cons
 
        ndo->ndo_protocol = "arcnet_linux_if";
        if (caplen < ARC_LINUX_HDRLEN || length < ARC_LINUX_HDRLEN) {
-               ND_PRINT("[|arcnet]");
+               nd_print_trunc(ndo);
                return (caplen);
        }
 
@@ -291,7 +291,7 @@ arcnet_linux_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, cons
        default:
                archdrlen = ARC_LINUX_HDRNEWLEN;
                if (caplen < ARC_LINUX_HDRNEWLEN || length < ARC_LINUX_HDRNEWLEN) {
-                       ND_PRINT("[|arcnet]");
+                       nd_print_trunc(ndo);
                        return (caplen);
                }
                break;
index 278495f83bb4b2c3bb42d6a48ab004d2c9293d09..a40efe2a00a802410c99b4f8596bb68f91d2c423 100644 (file)
@@ -106,7 +106,7 @@ llap_print(netdissect_options *ndo,
                return (length);
        }
        if (!ND_TTEST_LEN(bp, sizeof(*lp))) {
-               ND_PRINT(" [|llap]");
+               nd_print_trunc(ndo);
                return (0);     /* cut short by the snapshot length */
        }
        lp = (const struct LAP *)bp;
@@ -221,7 +221,7 @@ aarp_print(netdissect_options *ndo,
        ap = (const struct aarp *)bp;
        if (!ND_TTEST_SIZE(ap)) {
                /* Just bail if we don't have the whole chunk. */
-               ND_PRINT(" [|aarp]");
+               nd_print_trunc(ndo);
                return;
        }
        if (length < sizeof(*ap)) {
index aed2bea88036b4042400367ccb10686fa3084e25..373103dcc0e3dc2ecd53500ebee658b828188952 100644 (file)
@@ -159,11 +159,11 @@ ether_print(netdissect_options *ndo,
 
        ndo->ndo_protocol = "ether";
        if (caplen < ETHER_HDRLEN) {
-               ND_PRINT("[|ether]");
+               nd_print_trunc(ndo);
                return (caplen);
        }
        if (length < ETHER_HDRLEN) {
-               ND_PRINT("[|ether]");
+               nd_print_trunc(ndo);
                return (length);
        }
 
@@ -297,7 +297,7 @@ netanalyzer_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
         */
        ndo->ndo_protocol = "netanalyzer_if";
        if (h->len < 4 || h->caplen < 4) {
-               ND_PRINT("[|netanalyzer]");
+               nd_print_trunc(ndo);
                return (h->caplen);
        }
 
@@ -326,7 +326,7 @@ netanalyzer_transparent_if_print(netdissect_options *ndo,
         */
        ndo->ndo_protocol = "netanalyzer_transparent_if";
        if (h->len < 12 || h->caplen < 12) {
-               ND_PRINT("[|netanalyzer-transparent]");
+               nd_print_trunc(ndo);
                return (h->caplen);
        }
 
index 40eabe26eb69ef5a9440f631bd7770ee4b64b3a7..8c3c0806db27196cc6a6a705827b58d36b20a4ae 100644 (file)
@@ -2752,7 +2752,7 @@ ike_sub0_print(netdissect_options *ndo,
 
        return cp;
 trunc:
-       ND_PRINT(" [|isakmp]");
+       nd_print_trunc(ndo);
        return NULL;
 }
 
@@ -2920,7 +2920,7 @@ ikev2_sub0_print(netdissect_options *ndo, const struct isakmp *base,
 
        return cp;
 trunc:
-       ND_PRINT(" [|isakmp]");
+       nd_print_trunc(ndo);
        return NULL;
 }
 
@@ -3045,7 +3045,7 @@ isakmp_print(netdissect_options *ndo,
        ep = ndo->ndo_snapend;
 
        if ((const struct isakmp *)ep < p + 1) {
-               ND_PRINT("[|isakmp]");
+               nd_print_trunc(ndo);
                return;
        }
 
@@ -3130,6 +3130,6 @@ isakmp_rfc3948_print(netdissect_options *ndo,
        }
 
 trunc:
-       ND_PRINT("[|isakmp]");
+       nd_print_trunc(ndo);
        return;
 }
index eb016ae35a6ace542566ac66c1892dab4ec70b1a..86581ce05e231848af9623e28f89af91dd72747f 100644 (file)
@@ -1469,7 +1469,7 @@ cleanup:
 
 trunc:
        ndo->ndo_snapend = se;
-       ND_PRINT("[|ppp]");
+       nd_print_trunc(ndo);
 }
 
 
@@ -1602,7 +1602,7 @@ ppp_print(netdissect_options *ndo,
        handle_ppp(ndo, proto, p, length);
        return (hdr_len);
 trunc:
-       ND_PRINT("[|ppp]");
+       nd_print_trunc(ndo);
        return (0);
 }
 
@@ -1617,7 +1617,7 @@ ppp_if_print(netdissect_options *ndo,
 
        ndo->ndo_protocol = "ppp_if";
        if (caplen < PPP_HDRLEN) {
-               ND_PRINT("[|ppp]");
+               nd_print_trunc(ndo);
                return (caplen);
        }
 
@@ -1688,7 +1688,7 @@ ppp_hdlc_if_print(netdissect_options *ndo,
 
        ndo->ndo_protocol = "ppp_hdlc_if";
        if (caplen < 2) {
-               ND_PRINT("[|ppp]");
+               nd_print_trunc(ndo);
                return (caplen);
        }
 
@@ -1696,7 +1696,7 @@ ppp_hdlc_if_print(netdissect_options *ndo,
 
        case PPP_ADDRESS:
                if (caplen < 4 || length < 4) {
-                       ND_PRINT("[|ppp]");
+                       nd_print_trunc(ndo);
                        return (caplen);
                }
 
@@ -1722,7 +1722,7 @@ ppp_hdlc_if_print(netdissect_options *ndo,
 
        default:
                if (caplen < 4) {
-                       ND_PRINT("[|ppp]");
+                       nd_print_trunc(ndo);
                        return (caplen);
                }
 
@@ -1763,7 +1763,7 @@ ppp_bsdos_if_print(netdissect_options *ndo _U_,
 
        ndo->ndo_protocol = "ppp_bsdos_if";
        if (caplen < PPP_BSDI_HDRLEN) {
-               ND_PRINT("[|ppp]");
+               nd_print_trunc(ndo);
                return (caplen);
        }
 
index 0e570bf6cd08f54f61b16a14bd52880a93d9a295..571b7c5e5a1967edf1a4a2dad5f84b4dbd925ec3 100644 (file)
@@ -208,7 +208,7 @@ sll_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
                 * adds this many bytes of header to every packet in a
                 * cooked socket capture.
                 */
-               ND_PRINT("[|sll]");
+               nd_print_trunc(ndo);
                return (caplen);
        }
 
index 39cef42282765d20812b14b6a27cb03c0ecd69f7..f54b30e5e8e0f3c218c8eeb74720e2d21f732861 100644 (file)
@@ -1 +1 @@
-[|ppp]
+ [|ppp_hdlc_if]
index cad5686ca1c2d308b6398a7f412a7ea4197fad45..9616682537d98a37be93b7a9e0dcc37470aab860 100644 (file)
@@ -1 +1 @@
-IP 48.48.48.48.4500 > 48.48.48.48.12336: [|isakmp]
+IP 48.48.48.48.4500 > 48.48.48.48.12336:  [|isakmp_rfc3948]
index c43c935992bf8c817c4d5a1b71b1e4c178a1c044..6360c01e5abeb78c1e5258752c8f4276d364b6e7 100644 (file)
@@ -64,4 +64,4 @@
 30:30:30:30:30:30 > 30:30:30:30:30:30, ethertype Unknown (0x3030), length 262144: 
        0x0000:  3030 3030 3030 3030 3030 3030 3030 3030  0000000000000000
        0x0010:  3030 3030 3030 3030 3030 3030            000000000000
-IP 48.48.48.48.4500 > 48.48.48.48.12336: [|isakmp]
+IP 48.48.48.48.4500 > 48.48.48.48.12336:  [|isakmp_rfc3948]
index 8fde020c38bfbf233b9930cfd7fc50f66a66718b..a836b28f725614cca0c0c9553fe23388947b9785 100644 (file)
@@ -10,7 +10,7 @@ IP (tos 0x30, ttl 48, id 12331, offset 0, flags [none], proto UDP (17), length 1
     127.0.0.229.12416 > 127.236.0.1.1701:  l2tp:[TL](560/2056) ACCM(AVP too short)  [|l2tp]
 IP (tos 0x30, ttl 48, id 12336, offset 0, flags [none], proto UDP (17), length 12336, bad cksum 1f51 (->ab5d)!)
     127.0.0.0.0 > 0.0.0.0.2048: UDP, bad length 17704 > 12308
-[|ether]
+ [|ether]
 IP (tos 0x30, ttl 48, id 12336, offset 0, flags [none], proto UDP (17), length 12336, bad cksum 1f51 (->2a8b)!)
     127.0.0.229.12416 > 127.236.0.1.1701:  l2tp:[TL](560/2056) AVP-#48()  [|l2tp]
 IP (tos 0x30, ttl 48, id 12331, offset 0, flags [none], proto UDP (17), length 8752, bad cksum 1f51 (->3890)!)
@@ -21,7 +21,7 @@ IP (tos 0x30, ttl 48, id 12331, offset 0, flags [none], proto UDP (17), length 1
     127.0.0.229.12416 > 127.236.0.1.1701:  l2tp:[TL](560/2056) ACCM(AVP too short)  [|l2tp]
 IP (tos 0x30, ttl 48, id 12336, offset 0, flags [none], proto UDP (17), length 12336, bad cksum 1f51 (->ab5d)!)
     127.0.0.0.0 > 0.0.0.0.2048: UDP, bad length 17704 > 12308
-[|ether]
+ [|ether]
 IP (tos 0x30, ttl 48, id 12336, offset 0, flags [none], proto UDP (17), length 12336, bad cksum 1f51 (->2a8b)!)
     127.0.0.229.12416 > 127.236.0.1.1701:  l2tp:[TL](560/2056) AVP-#48()  [|l2tp]
 IP (tos 0x30, ttl 48, id 12331, offset 0, flags [none], proto UDP (17), length 8752, bad cksum 1f51 (->3890)!)
index 7ea809f64a6e84f9257b6a6f1ec1640f47266b4c..ab1f7822f49ab9bc8fcd137e4c4d1d5cbd8bbd89 100644 (file)
@@ -8,4 +8,4 @@ IP 192.168.0.18.47808 > 192.168.0.255.47808: UDP, length 24
 IP 192.168.0.24.40896 > 192.168.0.134.47808: UDP, length 30
 IP 192.168.0.24.47808 > 192.168.0.255.47808: UDP, length 20
 IP 192.168.0.9.37123 > 97.34.1.224.8472: OTV, flags [I] (0x9d), overlay 12124160, instance 4587520
-[|ether]
+ [|ether]
index 8cd05caa6da44d884218d080901b66112d410660..d116fcad7e80c71af94d5697f8879dc676a08c81 100644 (file)
@@ -1,2 +1,2 @@
  [|pktap_if]
-[|ppp]
+ [|ppp_hdlc_if]