Changeset fe4940e


Ignore:
Timestamp:
10/16/18 15:53:16 (2 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
develop, master, ringperformance
Children:
f3e1f19
Parents:
6a2f037
Message:

Cache packet framing length to avoid multiple calculations

Also when stripping vlan etc. headers, don't try to memmove if zero
bytes are going to be moved.

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h.in

    r37ee856 rfe4940e  
    551551        int wire_length;                /**< Cached wire length */
    552552        int payload_length;             /**< Cached payload length */
     553        int framing_length;             /**< Cached framing length */
    553554        void *l2_header;                /**< Cached link header */
    554555        libtrace_linktype_t link_type;  /**< Cached link type */
  • lib/protocols_l2.c

    r37ee856 rfe4940e  
    174174        }
    175175
    176         if (nextpayload != NULL) {
     176        if (nextpayload != NULL && removed > 0) {
    177177
    178178                ethernet->ether_type = ntohs(finalethertype);
Note: See TracChangeset for help on using the changeset viewer.