Ignore:
Timestamp:
10/31/08 13:51:59 (12 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
13fd6e1
Parents:
5d4e520
Message:

If we have a complete header, but truncated at the end of it, we shouldn't return NULL from
get_payload_from_* functions so we can distinguish it from a truncated header.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols_pktmeta.c

    rab25522 raa22b5b  
    2626
    2727        if (remaining) {
    28                 if (*remaining <= sizeof(*sll)) {
     28                if (*remaining < sizeof(*sll)) {
    2929                        *remaining = 0;
    3030                        return NULL;
     
    4545        libtrace_pflog_header_t *pflog = (libtrace_pflog_header_t*)link;
    4646        if (remaining) {
    47                 if (*remaining<=sizeof(*pflog)) {
     47                if (*remaining<sizeof(*pflog)) {
    4848                        *remaining = 0;
    4949                        return NULL;
     
    6262{
    6363        if (remaining) {
    64                 if (*remaining<=144) {
     64                /* Prism header is 144 bytes long */
     65                if (*remaining<144) {
    6566                        *remaining = 0;
    6667                        return NULL;
     
    8182        uint16_t rtaplen = bswap_le_to_host16(rtap->it_len);
    8283        if (remaining) {
    83                 if (*remaining <= rtaplen) {
     84                if (*remaining < rtaplen) {
    8485                        *remaining = 0;
    8586                        return NULL;
Note: See TracChangeset for help on using the changeset viewer.