Skip to content

Commit 33d9a2c

Browse files
Eric Dumazetdavem330
Eric Dumazet
authored andcommitted
net-gro: reset skb->pkt_type in napi_reuse_skb()
eth_type_trans() assumes initial value for skb->pkt_type is PACKET_HOST. This is indeed the value right after a fresh skb allocation. However, it is possible that GRO merged a packet with a different value (like PACKET_OTHERHOST in case macvlan is used), so we need to make sure napi->skb will have pkt_type set back to PACKET_HOST. Otherwise, valid packets might be dropped by the stack because their pkt_type is not PACKET_HOST. napi_reuse_skb() was added in commit 96e93ea ("gro: Add internal interfaces for VLAN"), but this bug always has been there. Fixes: 96e93ea ("gro: Add internal interfaces for VLAN") Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5396527 commit 33d9a2c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/core/dev.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5655,6 +5655,10 @@ static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb)
56555655
skb->vlan_tci = 0;
56565656
skb->dev = napi->dev;
56575657
skb->skb_iif = 0;
5658+
5659+
/* eth_type_trans() assumes pkt_type is PACKET_HOST */
5660+
skb->pkt_type = PACKET_HOST;
5661+
56585662
skb->encapsulation = 0;
56595663
skb_shinfo(skb)->gso_type = 0;
56605664
skb->truesize = SKB_TRUESIZE(skb_end_offset(skb));

0 commit comments

Comments
 (0)