All of lore.kernel.org
 help / color / mirror / Atom feed
* selftests: net: l2tp.sh regression starting with 6.1-rc1
@ 2023-03-29 12:24 Andrea Righi
  2023-03-29 14:16 ` Drewek, Wojciech
  0 siblings, 1 reply; 9+ messages in thread
From: Andrea Righi @ 2023-03-29 12:24 UTC (permalink / raw)
  To: Wojciech Drewek
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Shuah Khan, netdev, linux-kselftest, linux-kernel

I noticed that l2tp.sh net selftest is failing in recent kernels with
the following error:

 RTNETLINK answers: Protocol not supported

See also: https://bugs.launchpad.net/bugs/2013014

Apprently the module lt2p_ipv6 is not automatically loaded when the test
is trying to create an l2tp ipv6 tunnel.

I did a bisect and found that the offending commit is this one:

 65b32f801bfb ("uapi: move IPPROTO_L2TP to in.h")

I've temporarily reverted this commit for now, any suggestion on how to
fix this properly?

Thanks,
-Andrea

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: selftests: net: l2tp.sh regression starting with 6.1-rc1
  2023-03-29 12:24 selftests: net: l2tp.sh regression starting with 6.1-rc1 Andrea Righi
@ 2023-03-29 14:16 ` Drewek, Wojciech
  2023-03-29 15:26   ` Guillaume Nault
  0 siblings, 1 reply; 9+ messages in thread
From: Drewek, Wojciech @ 2023-03-29 14:16 UTC (permalink / raw)
  To: Andrea Righi
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Shuah Khan, netdev, linux-kselftest, linux-kernel

Hi,

Modifying UAPI was not a good idea although the patch should not break userspace (related discussion [1]).
We could revert this patch with one additional change (include l2tp.h in net/sched/cls_flower.c) but then again,
modifying UAPI. This patch was mostly cosmetic anyway.
Second option is to try to fix the automatic load. I'm not an expert but I think
MODULE_ALIAS_NET_PF_PROTO macro is somehow responsible for that. I noticed some comments saying that
"__stringify doesn't like enums" (this macro is using _stringify) and my patch defined IPPROTO_L2TP in enum.
We can just replace IPPROTO_L2TP with 115 (where this macro is used) in order to fix this.
I'm going to give it a try and will let you know.

Regards,
Wojtek

[1] https://lore.kernel.org/netdev/Ywis3PYhKiATnzXB@nanopsycho/

> -----Original Message-----
> From: Andrea Righi <andrea.righi@canonical.com>
> Sent: środa, 29 marca 2023 14:24
> To: Drewek, Wojciech <wojciech.drewek@intel.com>
> Cc: David S. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Shuah Khan <shuah@kernel.org>; netdev@vger.kernel.org; linux-kselftest@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: selftests: net: l2tp.sh regression starting with 6.1-rc1
> 
> I noticed that l2tp.sh net selftest is failing in recent kernels with
> the following error:
> 
>  RTNETLINK answers: Protocol not supported
> 
> See also: https://bugs.launchpad.net/bugs/2013014
> 
> Apprently the module lt2p_ipv6 is not automatically loaded when the test
> is trying to create an l2tp ipv6 tunnel.
> 
> I did a bisect and found that the offending commit is this one:
> 
>  65b32f801bfb ("uapi: move IPPROTO_L2TP to in.h")
> 
> I've temporarily reverted this commit for now, any suggestion on how to
> fix this properly?
> 
> Thanks,
> -Andrea

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: selftests: net: l2tp.sh regression starting with 6.1-rc1
  2023-03-29 14:16 ` Drewek, Wojciech
@ 2023-03-29 15:26   ` Guillaume Nault
  2023-03-29 15:39     ` Drewek, Wojciech
  0 siblings, 1 reply; 9+ messages in thread
From: Guillaume Nault @ 2023-03-29 15:26 UTC (permalink / raw)
  To: Drewek, Wojciech
  Cc: Andrea Righi, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Shuah Khan, netdev, linux-kselftest, linux-kernel

On Wed, Mar 29, 2023 at 02:16:37PM +0000, Drewek, Wojciech wrote:
> Hi,
> 
> Modifying UAPI was not a good idea although the patch should not break userspace (related discussion [1]).
> We could revert this patch with one additional change (include l2tp.h in net/sched/cls_flower.c) but then again,
> modifying UAPI. This patch was mostly cosmetic anyway.
> Second option is to try to fix the automatic load. I'm not an expert but I think
> MODULE_ALIAS_NET_PF_PROTO macro is somehow responsible for that. I noticed some comments saying that
> "__stringify doesn't like enums" (this macro is using _stringify) and my patch defined IPPROTO_L2TP in enum.
> We can just replace IPPROTO_L2TP with 115 (where this macro is used) in order to fix this.
> I'm going to give it a try and will let you know.

Yes, the modules aliases now have symbolic names:

$ modinfo l2tp_ip l2tp_ip6 | grep alias
alias:          net-pf-2-proto-IPPROTO_L2TP
alias:          net-pf-2-proto-2-type-IPPROTO_L2TP
alias:          net-pf-10-proto-IPPROTO_L2TP
alias:          net-pf-10-proto-2-type-IPPROTO_L2TP

Therefore, 'request_module("net-pf-%d-proto-%d-type-%d")' can't find
them.

My personal preference is for the second option: fix module loading by
using plain numbers in MODULE_ALIAS_*. We can always keep the symbolic
names in comments.

---- >8 ----

diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
index 4db5a554bdbd..afe94a390ef0 100644
--- a/net/l2tp/l2tp_ip.c
+++ b/net/l2tp/l2tp_ip.c
@@ -680,5 +680,5 @@ MODULE_VERSION("1.0");
 /* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like
  * enums
  */
-MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP);
-MODULE_ALIAS_NET_PF_PROTO(PF_INET, IPPROTO_L2TP);
+MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, 115 /* IPPROTO_L2TP */);
+MODULE_ALIAS_NET_PF_PROTO(PF_INET, 115 /* IPPROTO_L2TP */);
diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c
index 2478aa60145f..65d106b41951 100644
--- a/net/l2tp/l2tp_ip6.c
+++ b/net/l2tp/l2tp_ip6.c
@@ -809,5 +809,5 @@ MODULE_VERSION("1.0");
 /* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like
  * enums
  */
-MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, IPPROTO_L2TP);
-MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_L2TP);
+MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, 115 /* IPPROTO_L2TP */);
+MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 115 /* IPPROTO_L2TP */);


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: selftests: net: l2tp.sh regression starting with 6.1-rc1
  2023-03-29 15:26   ` Guillaume Nault
@ 2023-03-29 15:39     ` Drewek, Wojciech
  2023-03-29 16:52       ` Guillaume Nault
  0 siblings, 1 reply; 9+ messages in thread
From: Drewek, Wojciech @ 2023-03-29 15:39 UTC (permalink / raw)
  To: Guillaume Nault
  Cc: Andrea Righi, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Shuah Khan, netdev, linux-kselftest, linux-kernel



> -----Original Message-----
> From: Guillaume Nault <gnault@redhat.com>
> Sent: środa, 29 marca 2023 17:26
> To: Drewek, Wojciech <wojciech.drewek@intel.com>
> Cc: Andrea Righi <andrea.righi@canonical.com>; David S. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>;
> Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Shuah Khan <shuah@kernel.org>; netdev@vger.kernel.org;
> linux-kselftest@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: selftests: net: l2tp.sh regression starting with 6.1-rc1
> 
> On Wed, Mar 29, 2023 at 02:16:37PM +0000, Drewek, Wojciech wrote:
> > Hi,
> >
> > Modifying UAPI was not a good idea although the patch should not break userspace (related discussion [1]).
> > We could revert this patch with one additional change (include l2tp.h in net/sched/cls_flower.c) but then again,
> > modifying UAPI. This patch was mostly cosmetic anyway.
> > Second option is to try to fix the automatic load. I'm not an expert but I think
> > MODULE_ALIAS_NET_PF_PROTO macro is somehow responsible for that. I noticed some comments saying that
> > "__stringify doesn't like enums" (this macro is using _stringify) and my patch defined IPPROTO_L2TP in enum.
> > We can just replace IPPROTO_L2TP with 115 (where this macro is used) in order to fix this.
> > I'm going to give it a try and will let you know.
> 
> Yes, the modules aliases now have symbolic names:
> 
> $ modinfo l2tp_ip l2tp_ip6 | grep alias
> alias:          net-pf-2-proto-IPPROTO_L2TP
> alias:          net-pf-2-proto-2-type-IPPROTO_L2TP
> alias:          net-pf-10-proto-IPPROTO_L2TP
> alias:          net-pf-10-proto-2-type-IPPROTO_L2TP
> 
> Therefore, 'request_module("net-pf-%d-proto-%d-type-%d")' can't find
> them.
> 
> My personal preference is for the second option: fix module loading by
> using plain numbers in MODULE_ALIAS_*. We can always keep the symbolic
> names in comments.
> 
> ---- >8 ----
> 
> diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
> index 4db5a554bdbd..afe94a390ef0 100644
> --- a/net/l2tp/l2tp_ip.c
> +++ b/net/l2tp/l2tp_ip.c
> @@ -680,5 +680,5 @@ MODULE_VERSION("1.0");
>  /* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like
>   * enums
>   */
> -MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP);
> -MODULE_ALIAS_NET_PF_PROTO(PF_INET, IPPROTO_L2TP);
> +MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, 115 /* IPPROTO_L2TP */);
> +MODULE_ALIAS_NET_PF_PROTO(PF_INET, 115 /* IPPROTO_L2TP */);
> diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c
> index 2478aa60145f..65d106b41951 100644
> --- a/net/l2tp/l2tp_ip6.c
> +++ b/net/l2tp/l2tp_ip6.c
> @@ -809,5 +809,5 @@ MODULE_VERSION("1.0");
>  /* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like
>   * enums
>   */
> -MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, IPPROTO_L2TP);
> -MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_L2TP);
> +MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, 115 /* IPPROTO_L2TP */);
> +MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 115 /* IPPROTO_L2TP */);

Btw, am I blind or the alias with type was wrong the whole time?
pf goes first, then proto and type at the end according to the definition of MODULE_ALIAS_NET_PF_PROTO_TYPE
and here type (2) is 2nd and proto (115) is 3rd

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: selftests: net: l2tp.sh regression starting with 6.1-rc1
  2023-03-29 15:39     ` Drewek, Wojciech
@ 2023-03-29 16:52       ` Guillaume Nault
  2023-03-30  6:45         ` Andrea Righi
  0 siblings, 1 reply; 9+ messages in thread
From: Guillaume Nault @ 2023-03-29 16:52 UTC (permalink / raw)
  To: Drewek, Wojciech
  Cc: Andrea Righi, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Shuah Khan, netdev, linux-kselftest, linux-kernel

On Wed, Mar 29, 2023 at 03:39:13PM +0000, Drewek, Wojciech wrote:
> 
> 
> > -----Original Message-----
> > -MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, IPPROTO_L2TP);
> > -MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_L2TP);
> > +MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, 115 /* IPPROTO_L2TP */);
> > +MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 115 /* IPPROTO_L2TP */);
> 
> Btw, am I blind or the alias with type was wrong the whole time?
> pf goes first, then proto and type at the end according to the definition of MODULE_ALIAS_NET_PF_PROTO_TYPE
> and here type (2) is 2nd and proto (115) is 3rd

You're not blind :). The MODULE_ALIAS_NET_PF_PROTO_TYPE(...) is indeed
wrong. Auto-loading the l2tp_ip and l2tp_ip6 modules only worked
because of the extra MODULE_ALIAS_NET_PF_PROTO() declaration (as
inet_create() and inet6_create() fallback to "net-pf-%d-proto-%d" if
"net-pf-%d-proto-%d-type-%d" fails).


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: selftests: net: l2tp.sh regression starting with 6.1-rc1
  2023-03-29 16:52       ` Guillaume Nault
@ 2023-03-30  6:45         ` Andrea Righi
  2023-03-30  9:26           ` Drewek, Wojciech
  0 siblings, 1 reply; 9+ messages in thread
From: Andrea Righi @ 2023-03-30  6:45 UTC (permalink / raw)
  To: Guillaume Nault
  Cc: Drewek, Wojciech, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Shuah Khan, netdev, linux-kselftest, linux-kernel

On Wed, Mar 29, 2023 at 06:52:20PM +0200, Guillaume Nault wrote:
> On Wed, Mar 29, 2023 at 03:39:13PM +0000, Drewek, Wojciech wrote:
> > 
> > 
> > > -----Original Message-----
> > > -MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, IPPROTO_L2TP);
> > > -MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_L2TP);
> > > +MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, 115 /* IPPROTO_L2TP */);
> > > +MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 115 /* IPPROTO_L2TP */);
> > 
> > Btw, am I blind or the alias with type was wrong the whole time?
> > pf goes first, then proto and type at the end according to the definition of MODULE_ALIAS_NET_PF_PROTO_TYPE
> > and here type (2) is 2nd and proto (115) is 3rd
> 
> You're not blind :). The MODULE_ALIAS_NET_PF_PROTO_TYPE(...) is indeed
> wrong. Auto-loading the l2tp_ip and l2tp_ip6 modules only worked
> because of the extra MODULE_ALIAS_NET_PF_PROTO() declaration (as
> inet_create() and inet6_create() fallback to "net-pf-%d-proto-%d" if
> "net-pf-%d-proto-%d-type-%d" fails).

At this point I think using 115 directly is probably the best solution,
that is also what we do already with SOCK_DGRAM, but I would just update
the comment up above, instead of adding the inline comments.

Something like this maybe:

---

From: Andrea Righi <andrea.righi@canonical.com>
Subject: [PATCH] l2tp: generate correct module alias strings

Commit 65b32f801bfb ("uapi: move IPPROTO_L2TP to in.h") moved the
definition of IPPROTO_L2TP from a define to an enum, but since
__stringify doesn't work properly with enums, we ended up breaking the
modalias strings for the l2tp modules:

 $ modinfo l2tp_ip l2tp_ip6 | grep alias
 alias:          net-pf-2-proto-IPPROTO_L2TP
 alias:          net-pf-2-proto-2-type-IPPROTO_L2TP
 alias:          net-pf-10-proto-IPPROTO_L2TP
 alias:          net-pf-10-proto-2-type-IPPROTO_L2TP

Use the resolved number directly in MODULE_ALIAS_*() macros (as we
already do with SOCK_DGRAM) to fix the alias strings:

$ modinfo l2tp_ip l2tp_ip6 | grep alias
alias:          net-pf-2-proto-115
alias:          net-pf-2-proto-115-type-2
alias:          net-pf-10-proto-115
alias:          net-pf-10-proto-115-type-2

Moreover, fix the ordering of the parameters passed to
MODULE_ALIAS_NET_PF_PROTO_TYPE() by switching proto and type.

Fixes: 65b32f801bfb ("uapi: move IPPROTO_L2TP to in.h")
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
---
 net/l2tp/l2tp_ip.c  | 8 ++++----
 net/l2tp/l2tp_ip6.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
index 4db5a554bdbd..41a74fc84ca1 100644
--- a/net/l2tp/l2tp_ip.c
+++ b/net/l2tp/l2tp_ip.c
@@ -677,8 +677,8 @@ MODULE_AUTHOR("James Chapman <jchapman@katalix.com>");
 MODULE_DESCRIPTION("L2TP over IP");
 MODULE_VERSION("1.0");
 
-/* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like
- * enums
+/* Use the values of SOCK_DGRAM (2) as type and IPPROTO_L2TP (115) as protocol,
+ * because __stringify doesn't like enums
  */
-MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP);
-MODULE_ALIAS_NET_PF_PROTO(PF_INET, IPPROTO_L2TP);
+MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 115, 2);
+MODULE_ALIAS_NET_PF_PROTO(PF_INET, 115);
diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c
index 2478aa60145f..5137ea1861ce 100644
--- a/net/l2tp/l2tp_ip6.c
+++ b/net/l2tp/l2tp_ip6.c
@@ -806,8 +806,8 @@ MODULE_AUTHOR("Chris Elston <celston@katalix.com>");
 MODULE_DESCRIPTION("L2TP IP encapsulation for IPv6");
 MODULE_VERSION("1.0");
 
-/* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like
- * enums
+/* Use the values of SOCK_DGRAM (2) as type and IPPROTO_L2TP (115) as protocol,
+ * because __stringify doesn't like enums
  */
-MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, IPPROTO_L2TP);
-MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_L2TP);
+MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 115, 2);
+MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 115);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: selftests: net: l2tp.sh regression starting with 6.1-rc1
  2023-03-30  6:45         ` Andrea Righi
@ 2023-03-30  9:26           ` Drewek, Wojciech
  2023-03-30  9:56             ` Andrea Righi
  0 siblings, 1 reply; 9+ messages in thread
From: Drewek, Wojciech @ 2023-03-30  9:26 UTC (permalink / raw)
  To: Andrea Righi, Guillaume Nault
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Shuah Khan, netdev, linux-kselftest, linux-kernel



> -----Original Message-----
> From: Andrea Righi <andrea.righi@canonical.com>
> Sent: czwartek, 30 marca 2023 08:45
> To: Guillaume Nault <gnault@redhat.com>
> Cc: Drewek, Wojciech <wojciech.drewek@intel.com>; David S. Miller <davem@davemloft.net>; Eric Dumazet
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Shuah Khan <shuah@kernel.org>;
> netdev@vger.kernel.org; linux-kselftest@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: selftests: net: l2tp.sh regression starting with 6.1-rc1
> 
> On Wed, Mar 29, 2023 at 06:52:20PM +0200, Guillaume Nault wrote:
> > On Wed, Mar 29, 2023 at 03:39:13PM +0000, Drewek, Wojciech wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > -MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, IPPROTO_L2TP);
> > > > -MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_L2TP);
> > > > +MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, 115 /* IPPROTO_L2TP */);
> > > > +MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 115 /* IPPROTO_L2TP */);
> > >
> > > Btw, am I blind or the alias with type was wrong the whole time?
> > > pf goes first, then proto and type at the end according to the definition of MODULE_ALIAS_NET_PF_PROTO_TYPE
> > > and here type (2) is 2nd and proto (115) is 3rd
> >
> > You're not blind :). The MODULE_ALIAS_NET_PF_PROTO_TYPE(...) is indeed
> > wrong. Auto-loading the l2tp_ip and l2tp_ip6 modules only worked
> > because of the extra MODULE_ALIAS_NET_PF_PROTO() declaration (as
> > inet_create() and inet6_create() fallback to "net-pf-%d-proto-%d" if
> > "net-pf-%d-proto-%d-type-%d" fails).
> 
> At this point I think using 115 directly is probably the best solution,
> that is also what we do already with SOCK_DGRAM, but I would just update
> the comment up above, instead of adding the inline comments.

Agree,

I verified the fix on my machine, 
Do you want me to send the patch or you'll just send below one?

> 
> Something like this maybe:
> 
> ---
> 
> From: Andrea Righi <andrea.righi@canonical.com>
> Subject: [PATCH] l2tp: generate correct module alias strings
> 
> Commit 65b32f801bfb ("uapi: move IPPROTO_L2TP to in.h") moved the
> definition of IPPROTO_L2TP from a define to an enum, but since
> __stringify doesn't work properly with enums, we ended up breaking the
> modalias strings for the l2tp modules:
> 
>  $ modinfo l2tp_ip l2tp_ip6 | grep alias
>  alias:          net-pf-2-proto-IPPROTO_L2TP
>  alias:          net-pf-2-proto-2-type-IPPROTO_L2TP
>  alias:          net-pf-10-proto-IPPROTO_L2TP
>  alias:          net-pf-10-proto-2-type-IPPROTO_L2TP
> 
> Use the resolved number directly in MODULE_ALIAS_*() macros (as we
> already do with SOCK_DGRAM) to fix the alias strings:
> 
> $ modinfo l2tp_ip l2tp_ip6 | grep alias
> alias:          net-pf-2-proto-115
> alias:          net-pf-2-proto-115-type-2
> alias:          net-pf-10-proto-115
> alias:          net-pf-10-proto-115-type-2
> 
> Moreover, fix the ordering of the parameters passed to
> MODULE_ALIAS_NET_PF_PROTO_TYPE() by switching proto and type.
> 
> Fixes: 65b32f801bfb ("uapi: move IPPROTO_L2TP to in.h")
> Signed-off-by: Guillaume Nault <gnault@redhat.com>
> Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
> ---
>  net/l2tp/l2tp_ip.c  | 8 ++++----
>  net/l2tp/l2tp_ip6.c | 8 ++++----
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
> index 4db5a554bdbd..41a74fc84ca1 100644
> --- a/net/l2tp/l2tp_ip.c
> +++ b/net/l2tp/l2tp_ip.c
> @@ -677,8 +677,8 @@ MODULE_AUTHOR("James Chapman <jchapman@katalix.com>");
>  MODULE_DESCRIPTION("L2TP over IP");
>  MODULE_VERSION("1.0");
> 
> -/* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like
> - * enums
> +/* Use the values of SOCK_DGRAM (2) as type and IPPROTO_L2TP (115) as protocol,
> + * because __stringify doesn't like enums
>   */
> -MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP);
> -MODULE_ALIAS_NET_PF_PROTO(PF_INET, IPPROTO_L2TP);
> +MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 115, 2);
> +MODULE_ALIAS_NET_PF_PROTO(PF_INET, 115);
> diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c
> index 2478aa60145f..5137ea1861ce 100644
> --- a/net/l2tp/l2tp_ip6.c
> +++ b/net/l2tp/l2tp_ip6.c
> @@ -806,8 +806,8 @@ MODULE_AUTHOR("Chris Elston <celston@katalix.com>");
>  MODULE_DESCRIPTION("L2TP IP encapsulation for IPv6");
>  MODULE_VERSION("1.0");
> 
> -/* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like
> - * enums
> +/* Use the values of SOCK_DGRAM (2) as type and IPPROTO_L2TP (115) as protocol,
> + * because __stringify doesn't like enums
>   */
> -MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, IPPROTO_L2TP);
> -MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_L2TP);
> +MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 115, 2);
> +MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 115);
> --
> 2.39.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: selftests: net: l2tp.sh regression starting with 6.1-rc1
  2023-03-30  9:26           ` Drewek, Wojciech
@ 2023-03-30  9:56             ` Andrea Righi
  2023-03-30 10:12               ` Drewek, Wojciech
  0 siblings, 1 reply; 9+ messages in thread
From: Andrea Righi @ 2023-03-30  9:56 UTC (permalink / raw)
  To: Drewek, Wojciech
  Cc: Guillaume Nault, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Shuah Khan, netdev, linux-kselftest, linux-kernel

On Thu, Mar 30, 2023 at 09:26:06AM +0000, Drewek, Wojciech wrote:
> 
> 
> > -----Original Message-----
> > From: Andrea Righi <andrea.righi@canonical.com>
> > Sent: czwartek, 30 marca 2023 08:45
> > To: Guillaume Nault <gnault@redhat.com>
> > Cc: Drewek, Wojciech <wojciech.drewek@intel.com>; David S. Miller <davem@davemloft.net>; Eric Dumazet
> > <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Shuah Khan <shuah@kernel.org>;
> > netdev@vger.kernel.org; linux-kselftest@vger.kernel.org; linux-kernel@vger.kernel.org
> > Subject: Re: selftests: net: l2tp.sh regression starting with 6.1-rc1
> > 
> > On Wed, Mar 29, 2023 at 06:52:20PM +0200, Guillaume Nault wrote:
> > > On Wed, Mar 29, 2023 at 03:39:13PM +0000, Drewek, Wojciech wrote:
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > -MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, IPPROTO_L2TP);
> > > > > -MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_L2TP);
> > > > > +MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, 115 /* IPPROTO_L2TP */);
> > > > > +MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 115 /* IPPROTO_L2TP */);
> > > >
> > > > Btw, am I blind or the alias with type was wrong the whole time?
> > > > pf goes first, then proto and type at the end according to the definition of MODULE_ALIAS_NET_PF_PROTO_TYPE
> > > > and here type (2) is 2nd and proto (115) is 3rd
> > >
> > > You're not blind :). The MODULE_ALIAS_NET_PF_PROTO_TYPE(...) is indeed
> > > wrong. Auto-loading the l2tp_ip and l2tp_ip6 modules only worked
> > > because of the extra MODULE_ALIAS_NET_PF_PROTO() declaration (as
> > > inet_create() and inet6_create() fallback to "net-pf-%d-proto-%d" if
> > > "net-pf-%d-proto-%d-type-%d" fails).
> > 
> > At this point I think using 115 directly is probably the best solution,
> > that is also what we do already with SOCK_DGRAM, but I would just update
> > the comment up above, instead of adding the inline comments.
> 
> Agree,
> 
> I verified the fix on my machine, 
> Do you want me to send the patch or you'll just send below one?

Sent already. :)

-Andrea

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: selftests: net: l2tp.sh regression starting with 6.1-rc1
  2023-03-30  9:56             ` Andrea Righi
@ 2023-03-30 10:12               ` Drewek, Wojciech
  0 siblings, 0 replies; 9+ messages in thread
From: Drewek, Wojciech @ 2023-03-30 10:12 UTC (permalink / raw)
  To: Andrea Righi
  Cc: Guillaume Nault, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Shuah Khan, netdev, linux-kselftest, linux-kernel



> -----Original Message-----
> From: Andrea Righi <andrea.righi@canonical.com>
> Sent: czwartek, 30 marca 2023 11:56
> To: Drewek, Wojciech <wojciech.drewek@intel.com>
> Cc: Guillaume Nault <gnault@redhat.com>; David S. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Shuah Khan <shuah@kernel.org>; netdev@vger.kernel.org; linux-
> kselftest@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: selftests: net: l2tp.sh regression starting with 6.1-rc1
> 
> On Thu, Mar 30, 2023 at 09:26:06AM +0000, Drewek, Wojciech wrote:
> >
> >
> > > -----Original Message-----
> > > From: Andrea Righi <andrea.righi@canonical.com>
> > > Sent: czwartek, 30 marca 2023 08:45
> > > To: Guillaume Nault <gnault@redhat.com>
> > > Cc: Drewek, Wojciech <wojciech.drewek@intel.com>; David S. Miller <davem@davemloft.net>; Eric Dumazet
> > > <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Shuah Khan
> <shuah@kernel.org>;
> > > netdev@vger.kernel.org; linux-kselftest@vger.kernel.org; linux-kernel@vger.kernel.org
> > > Subject: Re: selftests: net: l2tp.sh regression starting with 6.1-rc1
> > >
> > > On Wed, Mar 29, 2023 at 06:52:20PM +0200, Guillaume Nault wrote:
> > > > On Wed, Mar 29, 2023 at 03:39:13PM +0000, Drewek, Wojciech wrote:
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > -MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, IPPROTO_L2TP);
> > > > > > -MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_L2TP);
> > > > > > +MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, 115 /* IPPROTO_L2TP */);
> > > > > > +MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 115 /* IPPROTO_L2TP */);
> > > > >
> > > > > Btw, am I blind or the alias with type was wrong the whole time?
> > > > > pf goes first, then proto and type at the end according to the definition of MODULE_ALIAS_NET_PF_PROTO_TYPE
> > > > > and here type (2) is 2nd and proto (115) is 3rd
> > > >
> > > > You're not blind :). The MODULE_ALIAS_NET_PF_PROTO_TYPE(...) is indeed
> > > > wrong. Auto-loading the l2tp_ip and l2tp_ip6 modules only worked
> > > > because of the extra MODULE_ALIAS_NET_PF_PROTO() declaration (as
> > > > inet_create() and inet6_create() fallback to "net-pf-%d-proto-%d" if
> > > > "net-pf-%d-proto-%d-type-%d" fails).
> > >
> > > At this point I think using 115 directly is probably the best solution,
> > > that is also what we do already with SOCK_DGRAM, but I would just update
> > > the comment up above, instead of adding the inline comments.
> >
> > Agree,
> >
> > I verified the fix on my machine,
> > Do you want me to send the patch or you'll just send below one?
> 
> Sent already. :)
> 
> -Andrea

Thank you!

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-03-30 10:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-29 12:24 selftests: net: l2tp.sh regression starting with 6.1-rc1 Andrea Righi
2023-03-29 14:16 ` Drewek, Wojciech
2023-03-29 15:26   ` Guillaume Nault
2023-03-29 15:39     ` Drewek, Wojciech
2023-03-29 16:52       ` Guillaume Nault
2023-03-30  6:45         ` Andrea Righi
2023-03-30  9:26           ` Drewek, Wojciech
2023-03-30  9:56             ` Andrea Righi
2023-03-30 10:12               ` Drewek, Wojciech

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.