diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-11-05 11:18:51 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-11-05 11:18:51 -0800 |
commit | 20119d41be224cf9ea821155ad0b267f7e40f234 (patch) | |
tree | 8886dc28e50f174bb12e099a01c4d262eed3611a /pcap-linux.c | |
parent | d8e39a9c306fe393a54029ca28693a63ab487e82 (diff) |
More descriptive name for bpf_filter1().
Call it bpf_filter_with_aux_data(), to better indicate what it does.
Also expand some comments and clean up white space a bit.
Diffstat (limited to 'pcap-linux.c')
-rw-r--r-- | pcap-linux.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pcap-linux.c b/pcap-linux.c index 101ad942..2f092b7f 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -1717,9 +1717,8 @@ pcap_read_packet(pcap_t *handle, pcap_handler callback, u_char *userdata) /* Run the packet filter if not using kernel filter */ if (handlep->filter_in_userland && handle->fcode.bf_insns) { - if (bpf_filter1(handle->fcode.bf_insns, bp, - packet_len, caplen, &aux_data) == 0) - { + if (bpf_filter_with_aux_data(handle->fcode.bf_insns, bp, + packet_len, caplen, &aux_data) == 0) { /* rejected by filter */ return 0; } @@ -4232,14 +4231,15 @@ static int pcap_handle_packet_mmap( * happen a lot later... */ bp = frame + tp_mac; if (handlep->filter_in_userland && handle->fcode.bf_insns) { - struct bpf_aux_data aux_data; + struct bpf_aux_data aux_data; - aux_data.vlan_tag = tp_vlan_tci & 0x0fff; - aux_data.vlan_tag_present = tp_vlan_tci_valid; + aux_data.vlan_tag = tp_vlan_tci & 0x0fff; + aux_data.vlan_tag_present = tp_vlan_tci_valid; - if (bpf_filter1(handle->fcode.bf_insns, bp, tp_len, tp_snaplen, &aux_data) == 0) - return 0; - } + if (bpf_filter_with_aux_data(handle->fcode.bf_insns, bp, + tp_len, tp_snaplen, &aux_data) == 0) + return 0; + } sll = (void *)frame + TPACKET_ALIGN(handlep->tp_hdrlen); if (!linux_check_direction(handle, sll)) |