X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/6fa52fef9bc38fdbcca7407cb039bdc7bc52a957..2db7c32de1a1c3e7f940e8275a285bbf44c658ad:/print-juniper.c diff --git a/print-juniper.c b/print-juniper.c index 05ff2f4a..19480758 100644 --- a/print-juniper.c +++ b/print-juniper.c @@ -22,9 +22,7 @@ __RCSID("NetBSD: print-juniper.c,v 1.3 2007/07/25 06:31:32 dogcow Exp "); #endif -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -892,7 +890,6 @@ juniper_mlppp_if_print(netdissect_options *ndo, } #endif - #ifdef DLT_JUNIPER_MFR void juniper_mfr_if_print(netdissect_options *ndo, @@ -1011,7 +1008,7 @@ juniper_mlfr_if_print(netdissect_options *ndo, * ATM1 PIC cookie format * * +-----+-------------------------+-------------------------------+ - * |fmtid| vc index | channel ID | + * |fmtid| vc index | channel ID | * +-----+-------------------------+-------------------------------+ */ @@ -1072,7 +1069,7 @@ juniper_atm1_if_print(netdissect_options *ndo, * ATM2 PIC cookie format * * +-------------------------------+---------+---+-----+-----------+ - * | channel ID | reserv |AAL| CCRQ| gap cnt | + * | channel ID |reserved |AAL| CCRQ| gap count | * +-------------------------------+---------+---+-----+-----------+ */ @@ -1166,7 +1163,6 @@ juniper_ppp_heuristic_guess(netdissect_options *ndo, default: return 0; /* did not find a ppp header */ - break; } return 1; /* we printed a ppp packet */ } @@ -1210,7 +1206,6 @@ ip_heuristic_guess(netdissect_options *ndo, break; default: return 0; /* did not find a ip header */ - break; } return 1; /* we printed an v4/v6 packet */ } @@ -1276,12 +1271,10 @@ juniper_parse_header(netdissect_options *ndo, int tlv_value; const u_char *tptr; - l2info->header_len = 0; l2info->cookie_len = 0; l2info->proto = 0; - l2info->length = h->len; l2info->caplen = h->caplen; l2info->flags = GET_U_1(p + 3); @@ -1433,7 +1426,6 @@ juniper_parse_header(netdissect_options *ndo, break; } - #ifdef DLT_JUNIPER_MFR /* MFR child links don't carry cookies */ if (l2info->pictype == DLT_JUNIPER_MFR && @@ -1451,10 +1443,7 @@ juniper_parse_header(netdissect_options *ndo, lp->s, l2info->cookie_len); - if (l2info->cookie_len > 8) { - nd_print_invalid(ndo); - return 0; - } + ND_ICHECKMSG_U("cookie length", l2info->cookie_len, >, 8); if (l2info->cookie_len > 0) { ND_TCHECK_LEN(p, l2info->cookie_len); @@ -1468,7 +1457,6 @@ juniper_parse_header(netdissect_options *ndo, if (ndo->ndo_eflag) ND_PRINT(": "); /* print demarc b/w L2/L3*/ - l2info->proto = GET_BE_U_2(p + l2info->cookie_len); } p+=l2info->cookie_len;