netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antony Antony <antony.antony@secunet.com>
To: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Antony Antony <antony.antony@secunet.com>,
	Florian Westphal <fw@strlen.de>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	David Ahern <dsahern@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	Andreas Gruenbacher <agruenba@redhat.com>,
	<devel@linux-ipsec.org>, <netdev@vger.kernel.org>
Subject: Re: [PATCH ipsec-next v2] udpencap: Remove Obsolete UDP_ENCAP_ESPINUDP_NON_IKE Support
Date: Thu, 11 Apr 2024 19:45:52 +0200	[thread overview]
Message-ID: <Zhgh0HsEx0uRiEtd@moon.secunet.de> (raw)
In-Reply-To: <ZhedyOIndjX3kben@gauss3.secunet.de>

On Thu, Apr 11, 2024 at 10:22:32 +0200, Steffen Klassert wrote:
> On Thu, Apr 04, 2024 at 10:51:31AM +0200, Antony Antony wrote:
> > The UDP_ENCAP_ESPINUDP_NON_IKE mode, introduced into the Linux kernel
> > in 2004 [2], has remained inactive and obsolete for an extended period.
> > 
> > This mode was originally defined in an early version of an IETF draft
> > [1] from 2001. By the time it was integrated into the kernel in 2004 [2],
> > it had already been replaced by UDP_ENCAP_ESPINUDP [3] in later
> > versions of draft-ietf-ipsec-udp-encaps, particularly in version 06.
> > 
> > Over time, UDP_ENCAP_ESPINUDP_NON_IKE has lost its relevance, with no
> > known use cases.
> > 
> > With this commit, we remove support for UDP_ENCAP_ESPINUDP_NON_IKE,
> > simplifying the codebase and eliminating unnecessary complexity.
> > Actually, we remove the functionality and wrap  UDP_ENCAP_ESPINUDP_NON_IKE
> > defination in "#ifndef __KERNEL__". If it is used again in kernel code
> > your build will fail.
> > 
> > References:
> > [1] https://datatracker.ietf.org/doc/html/draft-ietf-ipsec-udp-encaps-00.txt
> > 
> > [2] Commit that added UDP_ENCAP_ESPINUDP_NON_IKE to the Linux historic
> >     repository.
> > 
> >     Author: Andreas Gruenbacher <agruen@suse.de>
> >     Date: Fri Apr 9 01:47:47 2004 -0700
> > 
> >    [IPSEC]: Support draft-ietf-ipsec-udp-encaps-00/01, some ipec impls need it.
> > 
> > [3] Commit that added UDP_ENCAP_ESPINUDP to the Linux historic
> >     repository.
> > 
> >     Author: Derek Atkins <derek@ihtfp.com>
> >     Date: Wed Apr 2 13:21:02 2003 -0800
> > 
> >     [IPSEC]: Implement UDP Encapsulation framework.
> > 
> > Signed-off-by: Antony Antony <antony.antony@secunet.com>
> > ---
> > v1 -> v2
> > - removed defination wrapped in #ifndef __KERNEL__ It would falsly
> >   let userspace appliction build and break when running.
> > RFC -> v1
> > - keep removed defination wrapped in #ifndef __KERNEL__
> > ---
> >  include/uapi/linux/udp.h |  1 -
> >  net/ipv4/esp4.c          | 12 ------------
> >  net/ipv4/udp.c           |  2 --
> >  net/ipv4/xfrm4_input.c   | 13 -------------
> >  net/ipv6/esp6.c          | 12 ------------
> >  net/ipv6/xfrm6_input.c   | 13 -------------
> >  6 files changed, 53 deletions(-)
> > 
> > diff --git a/include/uapi/linux/udp.h b/include/uapi/linux/udp.h
> > index 4828794efcf8..1516f53698e0 100644
> > --- a/include/uapi/linux/udp.h
> > +++ b/include/uapi/linux/udp.h
> > @@ -36,7 +36,6 @@ struct udphdr {
> >  #define UDP_GRO		104	/* This socket can receive UDP GRO packets */
> > 
> >  /* UDP encapsulation types */
> > -#define UDP_ENCAP_ESPINUDP_NON_IKE	1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
> 
> Please don't remove that, it is part of the ABI.
> Typically this is left in and marked as: /* unused */

Where exactly should I add /* unused */ ?

I agree, it is part of the ABI. We should be careful when removing. However, the solution to obselete is not clear to me. Would you please elaborte on the solution? I see 3 options. Which one do you prefer? Or is there 4th option?

1. change the comment and leave the definition

-#define UDP_ENCAP_ESPINUDP_NON_IKE	1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
+#define UDP_ENCAP_ESPINUDP_NON_IKE	1 /* unused  draft-ietf-ipsec-nat-t-ike-00/01 */

Paul brought up a probable issue with this solution. This means user space would build without error while at runtime user space would fail.
Also kernel would build if someone add it.

2: wrap it in ifndef __KERNEL__ as Florian suggested 
-#define UDP_ENCAP_ESPINUDP_NON_IKE     1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
+#ifndef __KERNEL__
+#define UDP_ENCAP_ESPINUDP_NON_IKE     1 /* (obsolete) draft-ietf-ipsec-nat-t-ike-00/01 */
+#endif
+

Kernel would not build, however, usersapce would build. This is v2. It was not accepeted.

3. comment it completly?
-#define UDP_ENCAP_ESPINUDP_NON_IKE	1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
+ /* #define UDP_ENCAP_ESPINUDP_NON_IKE	1 unused draft-ietf-ipsec-nat-t-ike-00/01 */

This means kernel and userspace would fail to build when is used.
What is your preference? Then I can send a v3.

-antony

  reply	other threads:[~2024-04-11 17:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04  8:51 [PATCH ipsec-next v2] udpencap: Remove Obsolete UDP_ENCAP_ESPINUDP_NON_IKE Support Antony Antony
2024-04-04 13:48 ` [devel-ipsec] " Michael Richardson
2024-04-11  8:22 ` Steffen Klassert
2024-04-11 17:45   ` Antony Antony [this message]
2024-04-12  6:24     ` Steffen Klassert

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=Zhgh0HsEx0uRiEtd@moon.secunet.de \
    --to=antony.antony@secunet.com \
    --cc=agruenba@redhat.com \
    --cc=davem@davemloft.net \
    --cc=devel@linux-ipsec.org \
    --cc=dsahern@kernel.org \
    --cc=fw@strlen.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=steffen.klassert@secunet.com \
    --cc=willemdebruijn.kernel@gmail.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).