From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B62A7C43381 for ; Thu, 28 Mar 2019 11:12:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 840EC2082F for ; Thu, 28 Mar 2019 11:12:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726170AbfC1LMx (ORCPT ); Thu, 28 Mar 2019 07:12:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42948 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725846AbfC1LMx (ORCPT ); Thu, 28 Mar 2019 07:12:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F8C2307E048; Thu, 28 Mar 2019 11:12:52 +0000 (UTC) Received: from bistromath.localdomain (unknown [10.40.205.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB5156085B; Thu, 28 Mar 2019 11:12:48 +0000 (UTC) Date: Thu, 28 Mar 2019 12:12:47 +0100 From: Sabrina Dubroca To: Florian Westphal Cc: netdev@vger.kernel.org, steffen.klassert@secunet.com Subject: Re: [PATCH ipsec-next 04/11] xfrm: remove output indirection from xfrm_mode Message-ID: <20190328111247.GA19967@bistromath.localdomain> References: <20190327173140.16891-1-fw@strlen.de> <20190327173140.16891-5-fw@strlen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190327173140.16891-5-fw@strlen.de> User-Agent: Mutt/1.11.4 (2019-03-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 28 Mar 2019 11:12:52 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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