Changeset 7ca2c7d
- Timestamp:
- 11/01/06 13:09:03 (14 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:
- a31b4c7
- Parents:
- 2f3a25e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/trace.c
r76eeca0 r7ca2c7d 998 998 assert(filter); 999 999 assert(packet); 1000 1000 libtrace_packet_t *packet_copy = packet; 1001 1002 1001 1003 if (libtrace_to_pcap_dlt(trace_get_link_type(packet))==~0) { 1002 1004 /* Copy the packet, as we don't want to trash the one we 1003 1005 * were passed in 1004 1006 */ 1005 packet =trace_copy_packet(packet);1007 packet_copy=trace_copy_packet(packet); 1006 1008 free_packet_needed=true; 1007 while (libtrace_to_pcap_dlt(trace_get_link_type(packet))==~0) { 1008 if (!demote_packet(packet)) { 1009 while (libtrace_to_pcap_dlt(trace_get_link_type(packet_copy))== 1010 ~0) { 1011 if (!demote_packet(packet_copy)) { 1009 1012 trace_set_err_out(packet->trace, 1010 1013 TRACE_ERR_NO_CONVERSION, 1011 1014 "pcap does not support this format"); 1012 1015 if (free_packet_needed) { 1013 trace_destroy_packet(packet );1016 trace_destroy_packet(packet_copy); 1014 1017 } 1015 1018 return -1; … … 1018 1021 } 1019 1022 1020 linkptr = trace_get_link(packet );1023 linkptr = trace_get_link(packet_copy); 1021 1024 if (!linkptr) { 1022 1025 if (free_packet_needed) { 1023 trace_destroy_packet(packet );1026 trace_destroy_packet(packet_copy); 1024 1027 } 1025 1028 return 0; … … 1029 1032 * link type was 1030 1033 */ 1031 if (trace_bpf_compile(filter,packet )==-1) {1034 if (trace_bpf_compile(filter,packet_copy)==-1) { 1032 1035 if (free_packet_needed) { 1033 trace_destroy_packet(packet );1036 trace_destroy_packet(packet_copy); 1034 1037 } 1035 1038 return -1; 1036 1039 } 1037 1040 1038 clen = trace_get_capture_length(packet );1041 clen = trace_get_capture_length(packet_copy); 1039 1042 1040 1043 assert(filter->flag); 1041 1044 ret=bpf_filter(filter->filter.bf_insns,(u_char*)linkptr,clen,clen); 1042 1045 if (free_packet_needed) { 1043 trace_destroy_packet(packet );1046 trace_destroy_packet(packet_copy); 1044 1047 } 1045 1048 return ret;
Note: See TracChangeset
for help on using the changeset viewer.