]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-chdlc.c
Do the dump file Capsicum stuff in a common routine.
[tcpdump] / print-chdlc.c
index 8e8bb46dfff581a9024b7faf87762677a56fa01f..3951ef77cdff5ce7388f00b8ac8527c2eb8a58db 100644 (file)
@@ -56,7 +56,8 @@ chdlc_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register co
 }
 
 u_int
-chdlc_print(netdissect_options *ndo, register const u_char *p, u_int length) {
+chdlc_print(netdissect_options *ndo, register const u_char *p, u_int length)
+{
        u_int proto;
 
        proto = EXTRACT_16BITS(&p[2]);
@@ -75,11 +76,9 @@ chdlc_print(netdissect_options *ndo, register const u_char *p, u_int length) {
        case ETHERTYPE_IP:
                ip_print(ndo, p, length);
                break;
-#ifdef INET6
        case ETHERTYPE_IPV6:
                ip6_print(ndo, p, length);
                break;
-#endif
        case CHDLC_TYPE_SLARP:
                chdlc_slarp_print(ndo, p, length);
                break;
@@ -172,8 +171,7 @@ chdlc_slarp_print(netdissect_options *ndo, const u_char *cp, u_int length)
 
                 if (length >= SLARP_MAX_LEN) { /* uptime-stamp is optional */
                         cp += SLARP_MIN_LEN;
-                        if (!ND_TTEST2(*cp, 4))
-                                goto trunc;
+                        ND_TCHECK2(*cp, 4);
                         sec = EXTRACT_32BITS(cp) / 1000;
                         min = sec / 60; sec -= min * 60;
                         hrs = min / 60; min -= hrs * 60;