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_transport.c

    r35782f6 raa22b5b  
    3737                       
    3838                default:
     39                        printf("unknown ethertype=%04x\n",ethertype);
    3940                        *proto=0;
    4041                        return NULL;
     
    118119{
    119120        if (remaining) {
    120                 if (*remaining <= sizeof(libtrace_udp_t)) {
     121                if (*remaining < sizeof(libtrace_udp_t)) {
    121122                        *remaining = 0;
    122123                        return NULL;
     
    131132        unsigned int dlen = tcp->doff*4;
    132133        if (remaining) {
    133                 if (*remaining <= dlen) {
     134                if (*remaining < dlen) {
    134135                        *remaining = 0;
    135136                        return NULL;
     
    143144{
    144145        if (remaining) {
    145                 if (*remaining <= sizeof(libtrace_icmp_t)) {
     146                if (*remaining < sizeof(libtrace_icmp_t)) {
    146147                        *remaining = 0;
    147148                        return NULL;
Note: See TracChangeset for help on using the changeset viewer.