Skip to content

Commit

Permalink
[BRIDGE]: Unshare skb upon entry
Browse files Browse the repository at this point in the history
Due to the special location of the bridging hook, it should never see a
shared packet anyway (certainly not with any in-kernel code).  So it
makes sense to unshare the skb there if necessary as that will greatly
simplify the code below it (in particular, netfilter).

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Oct 15, 2007
1 parent f697c3e commit 7b99565
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/bridge/br_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb)
if (!is_valid_ether_addr(eth_hdr(skb)->h_source))
goto drop;

skb = skb_share_check(skb, GFP_ATOMIC);
if (!skb)
return NULL;

if (unlikely(is_link_local(dest))) {
/* Pause frames shouldn't be passed up by driver anyway */
if (skb->protocol == htons(ETH_P_PAUSE))
Expand Down

0 comments on commit 7b99565

Please sign in to comment.