diff options
author | David S. Miller | 2019-04-17 20:26:25 +0200 |
---|---|---|
committer | David S. Miller | 2019-04-17 20:26:25 +0200 |
commit | 6b0a7f84ea1fe248df96ccc4dd86e817e32ef65b (patch) | |
tree | 0a7976054052e793da782c2b7ec34eccfbf66449 /net/bridge/br_input.c | |
parent | Merge branch 's390-next' (diff) | |
parent | Merge tag 'for-linus-5.1-2' of git://github.com/cminyard/linux-ipmi (diff) | |
download | kernel-qcow2-linux-6b0a7f84ea1fe248df96ccc4dd86e817e32ef65b.tar.gz kernel-qcow2-linux-6b0a7f84ea1fe248df96ccc4dd86e817e32ef65b.tar.xz kernel-qcow2-linux-6b0a7f84ea1fe248df96ccc4dd86e817e32ef65b.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflict resolution of af_smc.c from Stephen Rothwell.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_input.c')
-rw-r--r-- | net/bridge/br_input.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c index 86dc46f6a68f..014af7efef25 100644 --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c @@ -196,13 +196,10 @@ static void __br_handle_local_finish(struct sk_buff *skb) /* note: already called with rcu_read_lock */ static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb) { - struct net_bridge_port *p = br_port_get_rcu(skb->dev); - __br_handle_local_finish(skb); - BR_INPUT_SKB_CB(skb)->brdev = p->br->dev; - br_pass_frame_up(skb); - return 0; + /* return 1 to signal the okfn() was called so it's ok to use the skb */ + return 1; } static int nf_hook_bridge_pre(struct sk_buff *skb, struct sk_buff **pskb) @@ -333,10 +330,18 @@ rx_handler_result_t br_handle_frame(struct sk_buff **pskb) goto forward; } - /* Deliver packet to local host only */ - NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, dev_net(skb->dev), - NULL, skb, skb->dev, NULL, br_handle_local_finish); - return RX_HANDLER_CONSUMED; + /* The else clause should be hit when nf_hook(): + * - returns < 0 (drop/error) + * - returns = 0 (stolen/nf_queue) + * Thus return 1 from the okfn() to signal the skb is ok to pass + */ + if (NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, + dev_net(skb->dev), NULL, skb, skb->dev, NULL, + br_handle_local_finish) == 1) { + return RX_HANDLER_PASS; + } else { + return RX_HANDLER_CONSUMED; + } } forward: |