[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190328111247.GA19967@bistromath.localdomain>
Date: Thu, 28 Mar 2019 12:12:47 +0100
From: Sabrina Dubroca <sd@...asysnail.net>
To: Florian Westphal <fw@...len.de>
Cc: netdev@...r.kernel.org, steffen.klassert@...unet.com
Subject: Re: [PATCH ipsec-next 04/11] xfrm: remove output indirection from
xfrm_mode
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
Powered by blists - more mailing lists