/* * 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, 1, 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"); } 83'/> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoopa Prabhu <roopa@cumulusnetworks.com>2017-02-07 06:43:23 -0800
committerDavid S. Miller <davem@davemloft.net>2017-02-07 14:14:12 -0500
commita8cab863a75f2d353588d4c3c37dc37c77b96c83 (patch)
treea2b14db32bd6ddd64a08aaa82a4c8188dd5b8861
parent85c727b5948344c8d559e2fda8925e9ddd41c29a (diff)
bridge: remove unnecessary check for vtbegin in br_fill_vlan_tinfo_range
vtbegin should not be NULL in this function, Its already checked by the caller. this should silence the below smatch complaint: net/bridge/br_netlink_tunnel.c:144 br_fill_vlan_tinfo_range() error: we previously assumed 'vtbegin' could be null (see line 130) net/bridge/br_netlink_tunnel.c 129 130 if (vtbegin && vtend && (vtend->vid - vtbegin->vid) > 0) { ^^^^^^^ Check for NULL. Fixes: efa5356b0d97 ("bridge: per vlan dst_metadata netlink support") Reported-By: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/bridge/br_netlink_tunnel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bridge/br_netlink_tunnel.c b/net/bridge/br_netlink_tunnel.c