ip_tunnel: Set network header properly for IP_ECN_decapsulate()
Subsystems (3)
PATCH v3 1/1 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 eccc1bb8d4b4 ("tunnel: drop packet if ECN present with not-ECT"). It was only removed from this spot in 3d7b46cd20e3 ("ip_tunnel: push generic protocol handling to ip_tunnel module.").
--- net/ipv4/ip_tunnel.c | 2 ++ 1 file changed, 2 insertions(+)
net/ipv4/ip_tunnel.c +2 -0
@@ -442,6 +442,8 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, tunnel->i_seqno =ntohl (tpi->seq) +1 ; } +skb_reset_network_header (skb); + err =IP_ECN_decapsulate (iph, skb);if (unlikely (err)) {if (log_ecn_error)
Signature · 1 line
1.9.1.423.g4596e3a
Quoted 11 lines · Ying Cai
In
ip_tunnel_rcv(), setskb->network_headerto inner IP header beforeIP_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 ineccc1bb8d4b4("tunnel: drop packet if ECN present with not-ECT"). It was only removed from this spot in3d7b46cd20e3("ip_tunnel: push generic protocol handling toip_tunnelmodule.").
David Miller
maintainerFrom: Ying Cai <[email protected]>
Date: Sun, 4 May 2014 15:20:04 -0700
Quoted 12 lines
In
ip_tunnel_rcv(), setskb->network_headerto inner IP header beforeIP_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 ineccc1bb8d4b4("tunnel: drop packet if ECN present with not-ECT"). It was only removed from this spot in3d7b46cd20e3("ip_tunnel: push generic protocol handling toip_tunnelmodule.").
Quoted 4 lines
Fixes 3d7b46cd20e3 ("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]>
Applied and queued up for -stable, thanks.