public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Sabrina Dubroca <sd@queasysnail.net>
To: Florian Westphal <fw@strlen.de>
Cc: netdev@vger.kernel.org, steffen.klassert@secunet.com
Subject: Re: [PATCH ipsec-next 03/11] xfrm: remove input indirection from xfrm_mode
Date: Thu, 28 Mar 2019 12:39:01 +0100	[thread overview]
Message-ID: <20190328113901.GC19967@bistromath.localdomain> (raw)
In-Reply-To: <20190327173140.16891-4-fw@strlen.de>

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	other threads:[~2019-03-28 11:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27 17:31 [PATCH ipsec-next 00/11] xfrm: remove xfrm_mode indirections Florian Westphal
2019-03-27 17:31 ` [PATCH ipsec-next 01/11] xfrm: place af number into xfrm_mode struct Florian Westphal
2019-03-27 17:31 ` [PATCH ipsec-next 02/11] xfrm: prefer family stored in " Florian Westphal
2019-03-27 17:31 ` [PATCH ipsec-next 03/11] xfrm: remove input indirection from xfrm_mode Florian Westphal
2019-03-28 11:39   ` Sabrina Dubroca [this message]
2019-03-28 11:46     ` Florian Westphal
2019-03-29 17:10   ` Eyal Birger
2019-03-29 17:19     ` Florian Westphal
2019-03-27 17:31 ` [PATCH ipsec-next 04/11] xfrm: remove output " Florian Westphal
2019-03-28 11:12   ` Sabrina Dubroca
2019-03-28 11:27     ` Florian Westphal
2019-03-28 11:35       ` Sabrina Dubroca
2019-03-27 17:31 ` [PATCH ipsec-next 05/11] xfrm: remove xmit " Florian Westphal
2019-03-27 17:31 ` [PATCH ipsec-next 06/11] xfrm: remove gso_segment " Florian Westphal
2019-03-27 17:31 ` [PATCH ipsec-next 07/11] xfrm: remove input2 " Florian Westphal
2019-03-27 17:31 ` [PATCH ipsec-next 08/11] xfrm: remove output2 " Florian Westphal
2019-03-28 22:28   ` kbuild test robot
2019-03-29  2:15   ` kbuild test robot
2019-03-27 17:31 ` [PATCH ipsec-next 09/11] xfrm: remove afinfo pointer " Florian Westphal
2019-03-28 14:13   ` Sabrina Dubroca
2019-03-27 17:31 ` [PATCH ipsec-next 10/11] xfrm: make xfrm modes builtin Florian Westphal
2019-03-29  3:54   ` kbuild test robot
2019-03-27 17:31 ` [PATCH ipsec-next 11/11] xfrm: store xfrm_mode directly, not its address Florian Westphal
2019-03-28 11:42 ` [PATCH ipsec-next 00/11] xfrm: remove xfrm_mode indirections Benedict Wong
2019-03-28 11:48   ` Florian Westphal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190328113901.GC19967@bistromath.localdomain \
    --to=sd@queasysnail.net \
    --cc=fw@strlen.de \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox