diff options
author | Changli Gao <xiaosuo@gmail.com> | 2010-12-25 04:41:30 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-06 20:33:05 +0100 |
commit | f88de8de5a8c8a8a73960d4432ceef2d38b7f86f (patch) | |
tree | cfbbf4195278a69944db9af044ad51b036957f49 /net/bridge/br_forward.c | |
parent | netconsole: clarify stopping message (diff) | |
download | linux-f88de8de5a8c8a8a73960d4432ceef2d38b7f86f.tar.xz linux-f88de8de5a8c8a8a73960d4432ceef2d38b7f86f.zip |
net: bridge: check the length of skb after nf_bridge_maybe_copy_header()
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 <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | net/bridge/br_forward.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c index 2bd11ec6d166..ee64287f1290 100644 --- a/net/bridge/br_forward.c +++ b/net/bridge/br_forward.c @@ -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; |