Changeset 41c254d for lib/protocols_pktmeta.c
- Timestamp:
- 07/02/08 23:47:26 (13 years ago)
- 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:
- ab25522
- Parents:
- 11c0f44
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/protocols_pktmeta.c
r35782f6 r41c254d 21 21 uint16_t *type, uint32_t *remaining) 22 22 { 23 libtrace_sll_header_t *sll; 24 25 sll = (libtrace_sll_header_t*) link; 26 27 if (remaining) { 28 if (*remaining <= sizeof(*sll)) { 29 *remaining = 0; 30 return NULL; 31 } 32 *remaining-=sizeof(*sll); 23 libtrace_sll_header_t *sll = (libtrace_sll_header_t*) link; 24 25 /* Determine SLL header length */ 26 uint32_t hlen = ntohs(sll->halen) + (sizeof(uint16_t) * 4); 27 28 if (remaining) { 29 if (*remaining <= hlen) { 30 *remaining = 0; 31 return NULL; 32 } 33 *remaining -= hlen; 33 34 } 34 35 35 36 if (type) *type = ntohs(sll->hatype); 36 37 37 return (void*) ((char*)sll+sizeof(*sll));38 return (void*) ((char*)sll + hlen); 38 39 39 40 }
Note: See TracChangeset
for help on using the changeset viewer.