From d873f54a704de4034e64483668776589c22c0837 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 16 Apr 2024 16:59:35 +0000 Subject: [PATCH] Revert "net: ip_tunnel: make sure to pull inner header in ip_tunnel_rcv()" This reverts commit ec6bb01e02cbd47781dd90775b631a1dc4bd9d2b which is commit b0ec2abf98267f14d032102551581c833b0659d3 upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: I8848ef10b837f2943ad2e56b56fd64d759558a81 Signed-off-by: Greg Kroah-Hartman --- net/ipv4/ip_tunnel.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 906c37c7f80d5..ba1decf81fe32 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c @@ -365,7 +365,7 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, { struct pcpu_sw_netstats *tstats; const struct iphdr *iph = ip_hdr(skb); - int nh, err; + int err; #ifdef CONFIG_NET_IPGRE_BROADCAST if (ipv4_is_multicast(iph->daddr)) { @@ -391,21 +391,8 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, tunnel->i_seqno = ntohl(tpi->seq) + 1; } - /* Save offset of outer header relative to skb->head, - * because we are going to reset the network header to the inner header - * and might change skb->head. - */ - nh = skb_network_header(skb) - skb->head; - skb_set_network_header(skb, (tunnel->dev->type == ARPHRD_ETHER) ? ETH_HLEN : 0); - if (!pskb_inet_may_pull(skb)) { - DEV_STATS_INC(tunnel->dev, rx_length_errors); - DEV_STATS_INC(tunnel->dev, rx_errors); - goto drop; - } - iph = (struct iphdr *)(skb->head + nh); - err = IP_ECN_decapsulate(iph, skb); if (unlikely(err)) { if (log_ecn_error)