Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f88de8de authored by Changli Gao's avatar Changli Gao Committed by David S. Miller
Browse files

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: default avatarChangli Gao <xiaosuo@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 38cfb907
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -41,18 +41,14 @@ 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))
		kfree_skb(skb);
	else {
	/* ip_fragment doesn't copy the MAC header */
		if (nf_bridge_maybe_copy_header(skb))
	if (nf_bridge_maybe_copy_header(skb) ||
	    (packet_length(skb) > skb->dev->mtu && !skb_is_gso(skb))) {
		kfree_skb(skb);
		else {
	} else {
		skb_push(skb, ETH_HLEN);
		dev_queue_xmit(skb);
	}
	}

	return 0;
}