Because packet length (length) >= capture length (caplen).
(see the sanity checks in print.c, pretty_print_packet() function)
u_char arc_type;
ndo->ndo_protocol = "arcnet_if";
- if (caplen < ARC_HDRLEN || length < ARC_HDRLEN) {
+ if (caplen < ARC_HDRLEN) {
nd_print_trunc(ndo);
return (caplen);
}
}
if (phds) {
- if (caplen < ARC_HDRNEWLEN || length < ARC_HDRNEWLEN) {
+ if (caplen < ARC_HDRNEWLEN) {
arcnet_print(ndo, p, length, 0, 0, 0);
ND_PRINT("[|phds]");
return (caplen);
flag = EXTRACT_U_1(ap->arc_flag);
if (flag == 0xff) {
- if (caplen < ARC_HDRNEWLEN_EXC || length < ARC_HDRNEWLEN_EXC) {
+ if (caplen < ARC_HDRNEWLEN_EXC) {
arcnet_print(ndo, p, length, 0, 0, 0);
ND_PRINT("[|phds extended]");
return (caplen);
u_char arc_type;
ndo->ndo_protocol = "arcnet_linux_if";
- if (caplen < ARC_LINUX_HDRLEN || length < ARC_LINUX_HDRLEN) {
+ if (caplen < ARC_LINUX_HDRLEN) {
nd_print_trunc(ndo);
return (caplen);
}
switch (arc_type) {
default:
archdrlen = ARC_LINUX_HDRNEWLEN;
- if (caplen < ARC_LINUX_HDRNEWLEN || length < ARC_LINUX_HDRNEWLEN) {
+ if (caplen < ARC_LINUX_HDRNEWLEN) {
nd_print_trunc(ndo);
return (caplen);
}
u_int hdrlen = 0;
ndo->ndo_protocol = "atm_if";
- if (caplen < 1 || length < 1) {
+ if (caplen < 1) {
nd_print_trunc(ndo);
return (caplen);
}
* Must have at least a DSAP, an SSAP, and the first byte of the
* control field.
*/
- if (caplen < 3 || length < 3) {
+ if (caplen < 3) {
nd_print_trunc(ndo);
return (caplen);
}
* packets? If so, could it be changed to use a
* new DLT_IEEE802_6 value if we added it?
*/
- if (caplen < 20 || length < 20) {
+ if (caplen < 20) {
nd_print_trunc(ndo);
return (caplen);
}
const bluetooth_h4_header* hdr = (const bluetooth_h4_header*)p;
ndo->ndo_protocol = "bt_if";
- if (caplen < BT_HDRLEN || length < BT_HDRLEN)
+ if (caplen < BT_HDRLEN)
goto trunc;
caplen -= BT_HDRLEN;
length -= BT_HDRLEN;
u_int length = h->len;
ndo->ndo_protocol = "nflog_if";
- if (caplen < sizeof(nflog_hdr_t) || length < sizeof(nflog_hdr_t))
+ if (caplen < sizeof(nflog_hdr_t))
goto trunc;
ND_TCHECK_SIZE(hdr);
const nflog_tlv_t *tlv;
/* We have some data. Do we have enough for the TLV header? */
- if (caplen < sizeof(nflog_tlv_t) || length < sizeof(nflog_tlv_t))
+ if (caplen < sizeof(nflog_tlv_t))
goto trunc; /* No. */
tlv = (const nflog_tlv_t *) p;
goto trunc; /* Yes. Give up now. */
/* Do we have enough data for the full TLV? */
- if (caplen < size || length < size)
+ if (caplen < size)
goto trunc; /* No. */
if (EXTRACT_HE_U_2(tlv->tlv_type) == NFULA_PAYLOAD) {
struct pcap_pkthdr nhdr;
ndo->ndo_protocol = "pktap_if";
- if (caplen < sizeof(pktap_header_t) || length < sizeof(pktap_header_t)) {
+ if (caplen < sizeof(pktap_header_t)) {
nd_print_trunc(ndo);
return (caplen);
}
nd_print_trunc(ndo);
return (caplen);
}
- if (caplen < hdrlen || length < hdrlen) {
+ if (caplen < hdrlen) {
nd_print_trunc(ndo);
return (caplen);
}
switch (EXTRACT_U_1(p)) {
case PPP_ADDRESS:
- if (caplen < 4 || length < 4) {
+ if (caplen < 4) {
nd_print_trunc(ndo);
return (caplen);
}
const struct ip *ip;
ndo->ndo_protocol = "sl_if";
- if (caplen < SLIP_HDRLEN || length < SLIP_HDRLEN) {
+ if (caplen < SLIP_HDRLEN) {
nd_print_trunc(ndo);
return (caplen);
}
if (ndo->ndo_eflag)
sliplink_print(ndo, p, ip, length);
- if (caplen < 1 || length < 1) {
+ if (caplen < 1) {
nd_print_trunc(ndo);
return (caplen + SLIP_HDRLEN);
}