Changeset d3320d1 for lib/trace.c


Ignore:
Timestamp:
07/16/10 11:42:23 (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:
53f179f
Parents:
b185327
Message:
  • Handle dodgy wire lengths better - this solution tends towards hand-waving, as it tends to just perpetuate the error rather than trying to fix it.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    rb185327 rd3320d1  
    840840                wire_len = trace_get_wire_length(packet);
    841841
    842                 assert(cap_len >= 0 && wire_len >= 0);
    843                 if (wire_len < cap_len)
     842                assert(cap_len >= 0);
     843
     844                /* There is the odd corrupt packet, e.g. in IPLS II, that have
     845                 * massively negative wire lens. We could assert fail here on
     846                 * them, but we could at least try the capture length instead.
     847                 *
     848                 * You may still run into problems if you try to write that
     849                 * packet, but at least reading should work OK.
     850                 */
     851                if (wire_len < 0)
     852                        *remaining = cap_len;
     853                else if (wire_len < cap_len)
    844854                        *remaining = wire_len;
    845855                else
Note: See TracChangeset for help on using the changeset viewer.