Changeset b56ea4d for lib/trace.c
- Timestamp:
- 12/10/04 11:24:22 (17 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:
- b597b64
- Parents:
- b49264a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/trace.c
r3fe7937 rb56ea4d 686 686 return -1; 687 687 } 688 if ((numbytes + dag_record_size) != rlen) {689 printf("read %d wanted %d\n",numbytes +dag_record_size, rlen);690 }688 //if ((numbytes + dag_record_size) != rlen) { 689 // printf("read %d wanted %d\n",numbytes +dag_record_size, rlen); 690 //} 691 691 packet->size = rlen; 692 692 … … 917 917 * @returns a pointer to the TCP header, or NULL if there is not a TCP packet 918 918 */ 919 920 #define SW_IP_OFFMASK 0xff1f 919 921 struct libtrace_tcp *trace_get_tcp(struct libtrace_packet_t *packet) { 920 922 struct libtrace_tcp *tcpptr = 0; … … 923 925 if(!(ipptr = trace_get_ip(packet))) { 924 926 return 0; 925 926 if ((ipptr->ip_p == 6) && ( ipptr->ip_off == 0 )){927 } 928 if ((ipptr->ip_p == 6) && ((ipptr->ip_off & SW_IP_OFFMASK) == 0)) { 927 929 tcpptr = (struct libtrace_tcp *)((ptrdiff_t)ipptr + (ipptr->ip_hl * 4)); 928 930 } … … 944 946 return 0; 945 947 } 946 if ( ipptr->ip_p == 17) {948 if ((ipptr->ip_p == 17) && ((ipptr->ip_off & SW_IP_OFFMASK) == 0)) { 947 949 udpptr = (struct libtrace_udp *)((ptrdiff_t)ipptr + (ipptr->ip_hl * 4)); 948 950 } … … 964 966 return 0; 965 967 } 966 if ( ipptr->ip_p == 1){968 if ((ipptr->ip_p == 1)&& ((ipptr->ip_off & SW_IP_OFFMASK) == 0 )){ 967 969 icmpptr = (struct libtrace_icmp *)((ptrdiff_t)ipptr + (ipptr->ip_hl * 4)); 968 970 }
Note: See TracChangeset
for help on using the changeset viewer.