Changeset c2afda6 for lib/protocols_l3.c


Ignore:
Timestamp:
01/21/10 10:10:46 (12 years ago)
Author:
Shane Alcock <salcock@…>
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:
1481ba7
Parents:
b5a23b3
Message:
  • Adjusted the "shortcut" protocol access functions to return NULL if a full header (minus options) is not present.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols_l3.c

    r59751a5 rc2afda6  
    4747
    4848        if (!ret || ethertype!=TRACE_ETHERTYPE_IPV6)
     49                return NULL;
     50
     51        /* Make sure we have at least the base IPv6 header */
     52        if (remaining < sizeof(libtrace_ip6_t))
    4953                return NULL;
    5054
     
    247251                                           * with these packets
    248252                                           */
     253
     254                        /* Ensure that optlen is not greater than the
     255                         * amount of buffer remaining */
     256                        if (*optlen > *len)
     257                                return 0;
     258                       
    249259                        (*len)-=*optlen;
    250260                        (*data)=(*ptr+2);
Note: See TracChangeset for help on using the changeset viewer.