/* * netsniff-ng - the packet sniffing beast * Copyright 2013 Daniel Borkmann. * Subject to the GPL, version 2. */ #include #include #include "xmalloc.h" #include "config.h" #include "bpf.h" #include "die.h" void bpf_try_compile(const char *rulefile, struct sock_fprog *bpf, uint32_t link_type) { int i, ret; const struct bpf_insn *ins; struct sock_filter *out; struct bpf_program _bpf; ret = pcap_compile_nopcap(65535, link_type, &_bpf, rulefile, 1, 0xffffffff); if (ret < 0) panic("Cannot compile filter %s\n", rulefile); bpf->len = _bpf.bf_len; bpf->filter = xrealloc(bpf->filter, bpf->len * sizeof(*out)); for (i = 0, ins = _bpf.bf_insns, out = bpf->filter; i < bpf->len; ++i, ++ins, ++out) { out->code = ins->code; out->jt = ins->jt; out->jf = ins->jf; out->k = ins->k; if (out->code == 0x06 && out->k > 0) out->k = 0xFFFFFFFF; } pcap_freecode(&_bpf); if (__bpf_validate(bpf) == 0) panic("This is not a valid BPF program!\n"); } ite-cleanup net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
path: root/net/ipv6
AgeCommit message (Expand)AuthorFilesLines
2017-02-07net: use dst_confirm_neigh for UDP, RAW, ICMP, L2TPJulian Anastasov4-15/+27
2017-02-07net: add confirm_neigh method to dst_opsJulian Anastasov1-0/+16
2017-02-07net: add dst_pending_confirm flag to skbuffJulian Anastasov1-0/+1
2017-02-07ipv6: sr: fix non static symbol warningsWei Yongjun1-4/+4
2017-02-04net: ipv6: Use compressed IPv6 addresses showing route replace errorDavid Ahern1-1/+1
2017-02-04net: ipv6: Change notifications for multipath delete to RTA_MULTIPATHDavid Ahern2-1/+28
2017-02-04net: ipv6: Change notifications for multipath add to RTA_MULTIPATHDavid Ahern2-3/+53
2017-02-04net: ipv6: Add support to dump multipath routes via RTA_MULTIPATH attributeDavid Ahern2-17/+105
2017-02-04net: ipv6: Allow shorthand delete of all nexthops in multipath routeDavid Ahern1-2/+36
2017-02-03Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-nextDavid S. Miller7-39/+28
2017-02-03net: ipv6: Set protocol to kernel for local routesDavid Ahern1-0/+1
2017-02-03tcp: add tcp_mss_clamp() helperEric Dumazet1-4/+1
2017-02-02Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2-2/+2
2017-02-02netfilter: allow logging from non-init namespacesMichal Kubeček1-1/+1
2017-02-02netfilter: merge ctinfo into nfct pointer storage areaFlorian Westphal1-1/+1
2017-02-02netfilter: add and use nf_ct_set helperFlorian Westphal3-8/+4
2017-02-02skbuff: add and use skb_nfct helperFlorian Westphal3-8/+8
2017-02-02netfilter: reset netfilter state when duplicating packetFlorian Westphal1-1/+1
2017-02-02netfilter: conntrack: no need to pass ctinfo to error handlerFlorian Westphal1-6/+6