Skip to content

Commit

Permalink
net: bridge: check the length of skb after nf_bridge_maybe_copy_header()
Browse files Browse the repository at this point in the history
Since nf_bridge_maybe_copy_header() may change the length of skb,
we should check the length of skb after it to handle the ppoe skbs.

Signed-off-by: Changli Gao <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
xiaosuo authored and davem330 committed Jan 6, 2011
1 parent 38cfb90 commit f88de8d
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions net/bridge/br_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,13 @@ static inline unsigned packet_length(const struct sk_buff *skb)

int br_dev_queue_push_xmit(struct sk_buff *skb)
{
/* drop mtu oversized packets except gso */
if (packet_length(skb) > skb->dev->mtu && !skb_is_gso(skb))
/* ip_fragment doesn't copy the MAC header */
if (nf_bridge_maybe_copy_header(skb) ||
(packet_length(skb) > skb->dev->mtu && !skb_is_gso(skb))) {
kfree_skb(skb);
else {
/* ip_fragment doesn't copy the MAC header */
if (nf_bridge_maybe_copy_header(skb))
kfree_skb(skb);
else {
skb_push(skb, ETH_HLEN);
dev_queue_xmit(skb);
}
} else {
skb_push(skb, ETH_HLEN);
dev_queue_xmit(skb);
}

return 0;
Expand Down

0 comments on commit f88de8d

Please sign in to comment.