Skip to content

Commit 154e07c

Browse files
Andrea Righidavem330
authored andcommitted
l2tp: generate correct module alias strings
Commit 65b32f8 ("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: 65b32f8 ("uapi: move IPPROTO_L2TP to in.h") Link: https://lore.kernel.org/lkml/ZCQt7hmodtUaBlCP@righiandr-XPS-13-7390 Signed-off-by: Guillaume Nault <[email protected]> Signed-off-by: Andrea Righi <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Tested-by: Wojciech Drewek <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 279d8ff commit 154e07c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

net/l2tp/l2tp_ip.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,8 @@ MODULE_AUTHOR("James Chapman <[email protected]>");
677677
MODULE_DESCRIPTION("L2TP over IP");
678678
MODULE_VERSION("1.0");
679679

680-
/* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like
681-
* enums
680+
/* Use the values of SOCK_DGRAM (2) as type and IPPROTO_L2TP (115) as protocol,
681+
* because __stringify doesn't like enums
682682
*/
683-
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP);
684-
MODULE_ALIAS_NET_PF_PROTO(PF_INET, IPPROTO_L2TP);
683+
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 115, 2);
684+
MODULE_ALIAS_NET_PF_PROTO(PF_INET, 115);

net/l2tp/l2tp_ip6.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,8 @@ MODULE_AUTHOR("Chris Elston <[email protected]>");
806806
MODULE_DESCRIPTION("L2TP IP encapsulation for IPv6");
807807
MODULE_VERSION("1.0");
808808

809-
/* Use the value of SOCK_DGRAM (2) directory, because __stringify doesn't like
810-
* enums
809+
/* Use the values of SOCK_DGRAM (2) as type and IPPROTO_L2TP (115) as protocol,
810+
* because __stringify doesn't like enums
811811
*/
812-
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 2, IPPROTO_L2TP);
813-
MODULE_ALIAS_NET_PF_PROTO(PF_INET6, IPPROTO_L2TP);
812+
MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 115, 2);
813+
MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 115);

0 commit comments

Comments
 (0)