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 7CBACC43381 for ; Thu, 28 Mar 2019 11:39:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B1252075E for ; Thu, 28 Mar 2019 11:39:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726307AbfC1LjF (ORCPT ); Thu, 28 Mar 2019 07:39:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42986 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbfC1LjF (ORCPT ); Thu, 28 Mar 2019 07:39:05 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C6058307EABB; Thu, 28 Mar 2019 11:39:04 +0000 (UTC) Received: from bistromath.localdomain (unknown [10.40.205.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D7A525D6B3; Thu, 28 Mar 2019 11:39:03 +0000 (UTC) Date: Thu, 28 Mar 2019 12:39:01 +0100 From: Sabrina Dubroca To: Florian Westphal Cc: netdev@vger.kernel.org, steffen.klassert@secunet.com Subject: Re: [PATCH ipsec-next 03/11] xfrm: remove input indirection from xfrm_mode Message-ID: <20190328113901.GC19967@bistromath.localdomain> References: <20190327173140.16891-1-fw@strlen.de> <20190327173140.16891-4-fw@strlen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190327173140.16891-4-fw@strlen.de> User-Agent: Mutt/1.11.4 (2019-03-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 28 Mar 2019 11:39:04 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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