Changeset cdcaef6 for lib/trace.c


Ignore:
Timestamp:
04/09/08 11:07:00 (13 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:
0bfd4a0
Parents:
de3d203
Message:
  • Add an error for an invalid snaplen
  • Use packet->buffer, not packet->payload when reading from a linux native interface
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    rde3d203 rcdcaef6  
    547547                        if (trace_is_err(libtrace)) {
    548548                                err = trace_get_err(libtrace);
     549                        }
     550                        if (*(int*)value<0
     551                                || *(int*)value>LIBTRACE_PACKET_BUFSIZE) {
     552                                trace_set_err(libtrace,TRACE_ERR_BAD_STATE,
     553                                        "Invalid snap length");
    549554                        }
    550555                        libtrace->snaplen=*(int*)value;
Note: See TracChangeset for help on using the changeset viewer.