Changeset fe7b292 for lib/format_pcap.c


Ignore:
Timestamp:
10/20/05 17:41:02 (16 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:
c95b923
Parents:
5496a87
Message:

Fixed issues in set_capture_length regarding the meaning of the parameters and return value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_pcap.c

    r9c6aa95 rfe7b292  
    369369        struct pcap_pkthdr *pcapptr = 0;
    370370        assert(packet);
    371         if (size > packet->size) {
     371        if ((size + sizeof(struct pcap_pkthdr)) > packet->size) {
    372372                // can't make a packet larger
    373                 return packet->size;
     373                return (packet->size - sizeof(struct pcap_pkthdr));
    374374        }
    375375        pcapptr = (struct pcap_pkthdr *)packet->buffer;
    376376        pcapptr->caplen = size + sizeof(struct pcap_pkthdr);
    377377        packet->size = pcapptr->caplen;
    378         return packet->size;
     378        return size;
    379379}
    380380
Note: See TracChangeset for help on using the changeset viewer.