netdev.vger.kernel.org archive mirror
 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 04/11] xfrm: remove output indirection from xfrm_mode
Date: Thu, 28 Mar 2019 12:12:47 +0100	[thread overview]
Message-ID: <20190328111247.GA19967@bistromath.localdomain> (raw)
In-Reply-To: <20190327173140.16891-5-fw@strlen.de>

Hi Florian,

2019-03-27, 18:31:33 +0100, Florian Westphal wrote:
> diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
> index 9333153bafda..01eb142ba6d0 100644
> --- a/net/xfrm/xfrm_output.c
> +++ b/net/xfrm/xfrm_output.c
[snip]
> +static int xfrm4_prepare_output(struct xfrm_state *x, struct sk_buff *skb)
> +{

Why no #if IS_ENABLED here? (and in xfrm6_prepare_output)

> +	int err;
> +
> +	err = xfrm_inner_extract_output(x, skb);
> +	if (err)
> +		return err;
> +
> +	IPCB(skb)->flags |= IPSKB_XFRM_TUNNEL_SIZE;
> +	skb->protocol = htons(ETH_P_IP);
> +
> +	return x->outer_mode->output2(x, skb);
> +}
> +
> +static int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb)
> +{
> +	int err;
> +
> +	err = xfrm_inner_extract_output(x, skb);
> +	if (err)
> +		return err;
> +
> +	skb->ignore_df = 1;
> +	skb->protocol = htons(ETH_P_IPV6);
> +
> +	return x->outer_mode->output2(x, skb);
> +}
> +
> +static int xfrm_outer_mode_output(struct xfrm_state *x, struct sk_buff *skb)
> +{
> +	switch (x->outer_mode->encap) {
> +	case XFRM_MODE_BEET:
> +	case XFRM_MODE_TUNNEL:
> +		if (x->outer_mode->family == AF_INET)
> +			return xfrm4_prepare_output(x, skb);
> +		if (x->outer_mode->family == AF_INET6)
> +			return xfrm6_prepare_output(x, skb);

Missing "break;" here?

> +	case XFRM_MODE_TRANSPORT:
> +		if (x->outer_mode->family == AF_INET)
> +			return xfrm4_transport_output(x, skb);
> +		if (x->outer_mode->family == AF_INET6)
> +			return xfrm6_transport_output(x, skb);
> +		break;
> +	case XFRM_MODE_ROUTEOPTIMIZATION:
> +		if (x->outer_mode->family == AF_INET6)
> +			return xfrm6_ro_output(x, skb);
> +		WARN_ON_ONCE(1);

Missing "break;" here too?

> +	default:
> +		WARN_ON_ONCE(1);
> +		break;
> +	}
> +
> +	return -EOPNOTSUPP;
> +}

-- 
Sabrina

  reply	other threads:[~2019-03-28 11:12 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
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 [this message]
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=20190328111247.GA19967@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;
as well as URLs for NNTP newsgroup(s).