Skip to content

Commit e96f2e7

Browse files
Ying Caidavem330
authored andcommitted
ip_tunnel: Set network header properly for IP_ECN_decapsulate()
In ip_tunnel_rcv(), set skb->network_header to inner IP header before IP_ECN_decapsulate(). Without the fix, IP_ECN_decapsulate() takes outer IP header as inner IP header, possibly causing error messages or packet drops. Note that this skb_reset_network_header() call was in this spot when the original feature for checking consistency of ECN bits through tunnels was added in eccc1bb ("tunnel: drop packet if ECN present with not-ECT"). It was only removed from this spot in 3d7b46c ("ip_tunnel: push generic protocol handling to ip_tunnel module."). Fixes: 3d7b46c ("ip_tunnel: push generic protocol handling to ip_tunnel module.") Reported-by: Neal Cardwell <[email protected]> Signed-off-by: Ying Cai <[email protected]> Acked-by: Neal Cardwell <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 780ce3a commit e96f2e7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/ipv4/ip_tunnel.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
442442
tunnel->i_seqno = ntohl(tpi->seq) + 1;
443443
}
444444

445+
skb_reset_network_header(skb);
446+
445447
err = IP_ECN_decapsulate(iph, skb);
446448
if (unlikely(err)) {
447449
if (log_ecn_error)

0 commit comments

Comments
 (0)