"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pcap-linux.c" between
libpcap-1.10.0.tar.gz and libpcap-1.10.1.tar.gz

About: libpcap is a packet filter library used by tools like tcpdump.

pcap-linux.c  (libpcap-1.10.0):pcap-linux.c  (libpcap-1.10.1)
skipping to change at line 119 skipping to change at line 119
#error "Libpcap will only work if TPACKET_V2 is supported; you must build for a 2.6.27 or later kernel" #error "Libpcap will only work if TPACKET_V2 is supported; you must build for a 2.6.27 or later kernel"
#endif #endif
/* check for memory mapped access avaibility. We assume every needed /* check for memory mapped access avaibility. We assume every needed
* struct is defined if the macro TPACKET_HDRLEN is defined, because it * struct is defined if the macro TPACKET_HDRLEN is defined, because it
* uses many ring related structs and macros */ * uses many ring related structs and macros */
#ifdef TPACKET3_HDRLEN #ifdef TPACKET3_HDRLEN
# define HAVE_TPACKET3 # define HAVE_TPACKET3
#endif /* TPACKET3_HDRLEN */ #endif /* TPACKET3_HDRLEN */
/*
* Not all compilers that are used to compile code to run on Linux have
* these builtins. For example, older versions of GCC don't, and at
* least some people are doing cross-builds for MIPS with older versions
* of GCC.
*/
#ifndef HAVE___ATOMIC_LOAD_N
#define __atomic_load_n(ptr, memory_model) (*(ptr))
#endif
#ifndef HAVE___ATOMIC_STORE_N
#define __atomic_store_n(ptr, val, memory_model) *(ptr) = (val)
#endif
#define packet_mmap_acquire(pkt) \ #define packet_mmap_acquire(pkt) \
(__atomic_load_n(&pkt->tp_status, __ATOMIC_ACQUIRE) != TP_STATUS_KERNEL) (__atomic_load_n(&pkt->tp_status, __ATOMIC_ACQUIRE) != TP_STATUS_KERNEL)
#define packet_mmap_release(pkt) \ #define packet_mmap_release(pkt) \
(__atomic_store_n(&pkt->tp_status, TP_STATUS_KERNEL, __ATOMIC_RELEASE)) (__atomic_store_n(&pkt->tp_status, TP_STATUS_KERNEL, __ATOMIC_RELEASE))
#define packet_mmap_v3_acquire(pkt) \ #define packet_mmap_v3_acquire(pkt) \
(__atomic_load_n(&pkt->hdr.bh1.block_status, __ATOMIC_ACQUIRE) != TP_STAT US_KERNEL) (__atomic_load_n(&pkt->hdr.bh1.block_status, __ATOMIC_ACQUIRE) != TP_STAT US_KERNEL)
#define packet_mmap_v3_release(pkt) \ #define packet_mmap_v3_release(pkt) \
(__atomic_store_n(&pkt->hdr.bh1.block_status, TP_STATUS_KERNEL, __ATOMIC_ RELEASE)) (__atomic_store_n(&pkt->hdr.bh1.block_status, TP_STATUS_KERNEL, __ATOMIC_ RELEASE))
#include <linux/types.h> #include <linux/types.h>
skipping to change at line 3881 skipping to change at line 3894
hdrp->sll_hatype = htons(sll->sll_hatype); hdrp->sll_hatype = htons(sll->sll_hatype);
hdrp->sll_halen = htons(sll->sll_halen); hdrp->sll_halen = htons(sll->sll_halen);
memcpy(hdrp->sll_addr, sll->sll_addr, SLL_ADDRLEN); memcpy(hdrp->sll_addr, sll->sll_addr, SLL_ADDRLEN);
hdrp->sll_protocol = sll->sll_protocol; hdrp->sll_protocol = sll->sll_protocol;
snaplen += sizeof(struct sll_header); snaplen += sizeof(struct sll_header);
} }
} }
if (handlep->filter_in_userland && handle->fcode.bf_insns) { if (handlep->filter_in_userland && handle->fcode.bf_insns) {
struct bpf_aux_data aux_data; struct pcap_bpf_aux_data aux_data;
aux_data.vlan_tag_present = tp_vlan_tci_valid; aux_data.vlan_tag_present = tp_vlan_tci_valid;
aux_data.vlan_tag = tp_vlan_tci & 0x0fff; aux_data.vlan_tag = tp_vlan_tci & 0x0fff;
if (pcap_filter_with_aux_data(handle->fcode.bf_insns, if (pcap_filter_with_aux_data(handle->fcode.bf_insns,
bp, bp,
tp_len, tp_len,
snaplen, snaplen,
&aux_data) == 0) &aux_data) == 0)
return 0; return 0;
 End of changes. 2 change blocks. 
1 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)