2019-03-27, 18:31:32 +0100, Florian Westphal wrote:
> diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
> index ea5ac053c15d..e3c7edd11e77 100644
> --- a/net/xfrm/xfrm_input.c
> +++ b/net/xfrm/xfrm_input.c
> @@ -186,6 +186,74 @@ int xfrm_prepare_input(struct xfrm_state *x, struct 
> sk_buff *skb)
>  }
>  EXPORT_SYMBOL(xfrm_prepare_input);
>  
> +/* Remove encapsulation header.
> + *
> + * The IP header will be moved over the top of the encapsulation header.
> + *
> + * On entry, skb->h shall point to where the IP header should be and skb->nh
> + * shall be set to where the IP header currently is.  skb->data shall point
> + * to the start of the payload.
> + */
> +static int xfrm4_transport_input(struct xfrm_state *x, struct sk_buff *skb)
> +{
> +#if IS_ENABLED(CONFIG_INET4_XFRM_MODE_TRANSPORT)

Nit: that should be CONFIG_INET_XFRM_MODE_TRANSPORT (without 4), and
in patch 10.

> +     int ihl = skb->data - skb_transport_header(skb);
> +
> +     if (skb->transport_header != skb->network_header) {
> +             memmove(skb_transport_header(skb),
> +                     skb_network_header(skb), ihl);
> +             skb->network_header = skb->transport_header;
> +     }
> +     ip_hdr(skb)->tot_len = htons(skb->len + ihl);
> +     skb_reset_transport_header(skb);
> +     return 0;
> +#else
> +     return -EOPNOTSUPP;
> +#endif
> +}

-- 
Sabrina

Reply via email to