This reverts commit
b7fff7058282c332ba1d8d236c9864ab21b16adf (partially)
The sanity check in print.c/pretty_print_packet() function, packet length
(length) >= capture length (caplen), apply when the ether_print()
function is called by ether_if_print(), netanalyzer_if_print() or
netanalyzer_transparent_if_print().
But the ether_print() function is called in some other cases, thus not
sure length always >= caplen.
nd_print_trunc(ndo);
return (caplen);
}
+ if (length < ETHER_HDRLEN) {
+ nd_print_trunc(ndo);
+ return (length);
+ }
if (ndo->ndo_eflag) {
if (print_encap_header != NULL)
nd_print_trunc(ndo);
return (hdrlen + caplen);
}
+ if (length < 4) {
+ ndo->ndo_protocol = "vlan";
+ nd_print_trunc(ndo);
+ return (hdrlen + length);
+ }
if (ndo->ndo_eflag) {
uint16_t tag = EXTRACT_BE_U_2(p);