From: Herbert Xu Date: Wed, 10 Oct 2007 22:42:23 +0000 (-0700) Subject: [IPSEC] beet: Fix extension header support on output X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bee0b40c0621396326d1c17b81833f59118a2d80;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [IPSEC] beet: Fix extension header support on output The beet output function completely kills any extension headers by replacing them with the IPv6 header. This is because it essentially ignores the result of ip6_find_1stfragopt by simply acting as if there aren't any extension headers. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/ipv6/xfrm6_mode_beet.c b/net/ipv6/xfrm6_mode_beet.c index 65e6b2a7fb31..d9366dfbf868 100644 --- a/net/ipv6/xfrm6_mode_beet.c +++ b/net/ipv6/xfrm6_mode_beet.c @@ -44,9 +44,9 @@ static int xfrm6_beet_output(struct xfrm_state *x, struct sk_buff *skb) hdr_len = ip6_find_1stfragopt(skb, &prevhdr); memmove(skb->data, iph, hdr_len); - skb_set_mac_header(skb, offsetof(struct ipv6hdr, nexthdr)); + skb_set_mac_header(skb, (prevhdr - x->props.header_len) - skb->data); skb_reset_network_header(skb); - skb_set_transport_header(skb, sizeof(struct ipv6hdr)); + skb_set_transport_header(skb, hdr_len); top_iph = ipv6_hdr(skb); ipv6_addr_copy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr);