Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on Fedora 41 (kernel 6.12.11-200) #47

Open
toreanderson opened this issue Feb 8, 2025 · 5 comments
Open

Build fails on Fedora 41 (kernel 6.12.11-200) #47

toreanderson opened this issue Feb 8, 2025 · 5 comments

Comments

@toreanderson
Copy link

The module does not build on a fully updated Fedora 41 host:

[fedora@fedora-41 modules]$ make
make -C /lib/modules/6.12.11-200.fc41.x86_64/build M=/home/fedora/nat46/nat46/modules modules
make[1]: Entering directory '/usr/src/kernels/6.12.11-200.fc41.x86_64'
  CC [M]  /home/fedora/nat46/nat46/modules/nat46-netdev.o
/home/fedora/nat46/nat46/modules/nat46-netdev.c: In function ‘nat46_netdev_setup’:
/home/fedora/nat46/nat46/modules/nat46-netdev.c:113:25: error: ‘NETIF_F_NETNS_LOCAL’ undeclared (first use in this function)
  113 |         dev->features = NETIF_F_NETNS_LOCAL;
      |                         ^~~~~~~~~~~~~~~~~~~
/home/fedora/nat46/nat46/modules/nat46-netdev.c:113:25: note: each undeclared identifier is reported only once for each function it appears in
/home/fedora/nat46/nat46/modules/nat46-netdev.c: At top level:
/home/fedora/nat46/nat46/modules/nat46-netdev.c:117:5: warning: no previous prototype for ‘nat46_netdev_create’ [-Wmissing-prototypes]
  117 | int nat46_netdev_create(struct net *net, char *basename, struct net_device **dev)
      |     ^~~~~~~~~~~~~~~~~~~
/home/fedora/nat46/nat46/modules/nat46-netdev.c:173:6: warning: no previous prototype for ‘nat46_netdev_destroy’ [-Wmissing-prototypes]
  173 | void nat46_netdev_destroy(struct net_device *dev)
      |      ^~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/spinlock.h:305,
                 from ./include/linux/sched.h:2153,
                 from ./include/linux/percpu.h:12,
                 from ./arch/x86/include/asm/msr.h:15,
                 from ./arch/x86/include/asm/tsc.h:10,
                 from ./arch/x86/include/asm/timex.h:6,
                 from ./include/linux/timex.h:67,
                 from ./include/linux/time32.h:13,
                 from ./include/linux/time.h:60,
                 from ./include/linux/skbuff.h:15,
                 from ./include/linux/if_arp.h:22,
                 from /home/fedora/nat46/nat46/modules/nat46-netdev.c:19:
/home/fedora/nat46/nat46/modules/nat46-netdev.c: In function ‘find_dev’:
/home/fedora/nat46/nat46/modules/nat46-netdev.c:196:20: error: ‘dev_base_lock’ undeclared (first use in this function); did you mean ‘device_lock’?
  196 |         read_lock(&dev_base_lock);
      |                    ^~~~~~~~~~~~~
./include/linux/rwlock.h:56:48: note: in definition of macro ‘read_lock’
   56 | #define read_lock(lock)         _raw_read_lock(lock)
      |                                                ^~~~
/home/fedora/nat46/nat46/modules/nat46-netdev.c: In function ‘nat64_show_all_configs’:
/home/fedora/nat46/nat46/modules/nat46-netdev.c:303:20: error: ‘dev_base_lock’ undeclared (first use in this function); did you mean ‘device_lock’?
  303 |         read_lock(&dev_base_lock);
      |                    ^~~~~~~~~~~~~
./include/linux/rwlock.h:56:48: note: in definition of macro ‘read_lock’
   56 | #define read_lock(lock)         _raw_read_lock(lock)
      |                                                ^~~~
/home/fedora/nat46/nat46/modules/nat46-netdev.c: In function ‘nat46_destroy_all’:
/home/fedora/nat46/nat46/modules/nat46-netdev.c:334:28: error: ‘dev_base_lock’ undeclared (first use in this function); did you mean ‘device_lock’?
  334 |                 read_lock(&dev_base_lock);
      |                            ^~~~~~~~~~~~~
./include/linux/rwlock.h:56:48: note: in definition of macro ‘read_lock’
   56 | #define read_lock(lock)         _raw_read_lock(lock)
      |                                                ^~~~
make[3]: *** [scripts/Makefile.build:229: /home/fedora/nat46/nat46/modules/nat46-netdev.o] Error 1
make[2]: *** [/usr/src/kernels/6.12.11-200.fc41.x86_64/Makefile:1977: /home/fedora/nat46/nat46/modules] Error 2
make[1]: *** [Makefile:236: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/kernels/6.12.11-200.fc41.x86_64'
make: *** [Makefile:6: all] Error 2
@angus19
Copy link
Contributor

angus19 commented Feb 18, 2025

@toreanderson Please help verify if the fix below works for Fedora 41. Thanks.
Fix build failures observed so far #49

@toreanderson
Copy link
Author

There are fewer errors now (the lock stuff appears fixed), but one remains:

[fedora@fedora-41 modules]$ make
make -C /lib/modules/6.12.11-200.fc41.x86_64/build M=/home/fedora/nat46/nat46/modules modules
make[1]: Entering directory '/usr/src/kernels/6.12.11-200.fc41.x86_64'
  CC [M]  /home/fedora/nat46/nat46/modules/nat46-netdev.o
/home/fedora/nat46/nat46/modules/nat46-netdev.c: In function ‘nat46_netdev_setup’:
/home/fedora/nat46/nat46/modules/nat46-netdev.c:122:25: error: ‘NETIF_F_NETNS_LOCAL’ undeclared (first use in this function)
  122 |         dev->features = NETIF_F_NETNS_LOCAL;
      |                         ^~~~~~~~~~~~~~~~~~~
/home/fedora/nat46/nat46/modules/nat46-netdev.c:122:25: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [scripts/Makefile.build:229: /home/fedora/nat46/nat46/modules/nat46-netdev.o] Error 1
make[2]: *** [/usr/src/kernels/6.12.11-200.fc41.x86_64/Makefile:1977: /home/fedora/nat46/nat46/modules] Error 2
make[1]: *** [Makefile:236: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/kernels/6.12.11-200.fc41.x86_64'
make: *** [Makefile:8: all] Error 2

@angus19
Copy link
Contributor

angus19 commented Feb 18, 2025

Please do an extra patch to see if we are good. Thanks.

diff --git a/nat46/modules/nat46-netdev.c b/nat46/modules/nat46-netdev.c
index 75bdda2..aef959b 100644
--- a/nat46/modules/nat46-netdev.c
+++ b/nat46/modules/nat46-netdev.c
@@ -17,7 +17,6 @@
 
 
 #include <linux/if_arp.h>
-#include <linux/netdev_features.h>
 #include <linux/netdevice.h>
 #include <linux/route.h>
 #include <linux/skbuff.h>
@@ -119,7 +118,11 @@ static void nat46_netdev_setup(struct net_device *dev)
	dev->hard_header_len = 0;
	dev->addr_len = 0;
	dev->mtu = 16384; /* iptables does reassembly. Rather than using ETH_DATA_LEN, let's try to get as much mileage as we can with the Linux stack */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,12,0)
	dev->features = NETIF_F_NETNS_LOCAL;
+#else
+	dev->netns_local = true;
+#endif
	dev->flags = IFF_NOARP | IFF_POINTOPOINT;
 }
 

@toreanderson
Copy link
Author

That makes it build, but with a warning:

[fedora@fedora-41 modules]$ make
make -C /lib/modules/6.12.11-200.fc41.x86_64/build M=/home/fedora/nat46/nat46/modules modules
make[1]: Entering directory '/usr/src/kernels/6.12.11-200.fc41.x86_64'
  CC [M]  /home/fedora/nat46/nat46/modules/nat46-netdev.o
  CC [M]  /home/fedora/nat46/nat46/modules/nat46-module.o
  CC [M]  /home/fedora/nat46/nat46/modules/nat46-core.o
/home/fedora/nat46/nat46/modules/nat46-core.c:32:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
   32 | void static
      | ^~~~
  CC [M]  /home/fedora/nat46/nat46/modules/nat46-glue.o
  LD [M]  /home/fedora/nat46/nat46/modules/nat46.o
  MODPOST /home/fedora/nat46/nat46/modules/Module.symvers
  CC [M]  /home/fedora/nat46/nat46/modules/nat46.mod.o
  CC [M]  /home/fedora/nat46/nat46/modules/.module-common.o
  LD [M]  /home/fedora/nat46/nat46/modules/nat46.ko
  BTF [M] /home/fedora/nat46/nat46/modules/nat46.ko
Skipping BTF generation for /home/fedora/nat46/nat46/modules/nat46.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/kernels/6.12.11-200.fc41.x86_64'

@angus19
Copy link
Contributor

angus19 commented Feb 18, 2025

This time it is a typo. Let me fix that. Will create a new PR for fixing all errors/warnings.

angus19 added a commit to angus19/nat46 that referenced this issue Feb 19, 2025
Build fails on Fedora 41 (kernel 6.12.11-200)  (ayourtch#47)
Build fails on Ubuntu 20.04 (kernel 5.4.0-205-generic)  (ayourtch#48)
angus19 added a commit to angus19/nat46 that referenced this issue Feb 19, 2025
Build fails on Fedora 41 (kernel 6.12.11-200)  (ayourtch#47)
Build fails on Ubuntu 20.04 (kernel 5.4.0-205-generic)  (ayourtch#48)
ayourtch pushed a commit that referenced this issue Feb 22, 2025
Build fails on Fedora 41 (kernel 6.12.11-200)  (#47)
Build fails on Ubuntu 20.04 (kernel 5.4.0-205-generic)  (#48)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants