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

Commit c80a8512 authored by Li RongQing's avatar Li RongQing Committed by David S. Miller
Browse files

net/core: move vlan_depth out of while loop in skb_network_protocol()



[ Bug added added in commit 05e8ef4a (net: factor out
  skb_mac_gso_segment() from skb_gso_segment() ) ]

move vlan_depth out of while loop, or else vlan_depth always is ETH_HLEN,
can not be increased, and lead to infinite loop when frame has two vlan headers.

Signed-off-by: default avatarLi RongQing <roy.qing.li@gmail.com>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 45549a68
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2219,9 +2219,9 @@ struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
	struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT);
	struct packet_offload *ptype;
	__be16 type = skb->protocol;
	int vlan_depth = ETH_HLEN;

	while (type == htons(ETH_P_8021Q)) {
		int vlan_depth = ETH_HLEN;
		struct vlan_hdr *vh;

		if (unlikely(!pskb_may_pull(skb, vlan_depth + VLAN_HLEN)))