Skip to content

Commit c80a851

Browse files
Li RongQingdavem330
authored andcommitted
net/core: move vlan_depth out of while loop in skb_network_protocol()
[ Bug added added in commit 05e8ef4 (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: Li RongQing <roy.qing.li@gmail.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 45549a6 commit c80a851

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2219,9 +2219,9 @@ struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
22192219
struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT);
22202220
struct packet_offload *ptype;
22212221
__be16 type = skb->protocol;
2222+
int vlan_depth = ETH_HLEN;
22222223

22232224
while (type == htons(ETH_P_8021Q)) {
2224-
int vlan_depth = ETH_HLEN;
22252225
struct vlan_hdr *vh;
22262226

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

0 commit comments

Comments
 (0)