Changeset 9dc77f3


Ignore:
Timestamp:
02/02/10 15:52:06 (11 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:
6dc74e1
Parents:
226c08b
Message:
  • Ensure get_*_port functions always return 0 for ICMP
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols_transport.c

    rc2afda6 r9dc77f3  
    184184{
    185185        uint32_t remaining;
     186        uint8_t proto;
    186187        const struct ports_t *port =
    187188                (const struct ports_t*)trace_get_transport((libtrace_packet_t*)packet,
    188                         NULL, &remaining);
     189                        &proto, &remaining);
    189190
    190191        /* snapped too early */
    191192        if (remaining<2)
     193                return 0;
     194
     195        /* ICMP *technically* doesn't have ports */
     196        if (proto == TRACE_IPPROTO_ICMP)
    192197                return 0;
    193198
     
    202207{
    203208        uint32_t remaining;
     209        uint8_t proto;
    204210        struct ports_t *port =
    205211                (struct ports_t*)trace_get_transport((libtrace_packet_t*)packet,
    206                         NULL, &remaining);
     212                        &proto, &remaining);
    207213        /* snapped to early */
    208214        if (remaining<4)
     215                return 0;
     216       
     217        /* ICMP *technically* doesn't have ports */
     218        if (proto == TRACE_IPPROTO_ICMP)
    209219                return 0;
    210220
Note: See TracChangeset for help on using the changeset viewer.