Changeset 530cef6 for lib/protocols_l3.c


Ignore:
Timestamp:
10/24/08 09:58:02 (13 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:
4ba74cc
Parents:
8babb98
Message:
  • Renamed hideous get_*_payload_from_ethernet_payload API functions to match the get_payload_from_* naming convention
  • trace_get_payload_from_vlan now returns NULL if passed something other than a vlan header or there is no header present after the vlan header, instead of returning the original header that was passed in
  • trace_get_payload_from_ip* functions now check if the ip header passed in is NULL and return NULL appropriately
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols_l3.c

    r11c0f44 r530cef6  
    4949        void *trans_ptr = 0;
    5050
    51         if ((ntohs(ipptr->ip_off) & SW_IP_OFFMASK) != 0) {
     51        if (ipptr == NULL)
     52                return NULL;
     53
     54        if ((ntohs(ipptr->ip_off) & SW_IP_OFFMASK) != 0) {
    5255                if (remaining)
    5356                        *remaining = 0;         
     
    7679        uint8_t nxt = ipptr->nxt;
    7780
     81        if (ipptr == NULL)
     82                return NULL;
     83       
    7884        if (remaining) {
    7985                if (*remaining<sizeof(libtrace_ip6_t)) {
     
    156162                switch(*ethertype) {
    157163                case 0x8100: /* VLAN */
    158                         iphdr=trace_get_vlan_payload_from_ethernet_payload(
     164                        iphdr=trace_get_payload_from_vlan(
    159165                                          iphdr,ethertype,remaining);
    160166                        continue;
    161167                case 0x8847: /* MPLS */
    162                         iphdr=trace_get_mpls_payload_from_ethernet_payload(
     168                        iphdr=trace_get_payload_from_mpls(
    163169                                          iphdr,ethertype,remaining);
    164170
Note: See TracChangeset for help on using the changeset viewer.