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

kernel build failure due to 'error: invalid use of undefined type' #38

Open
enihcam opened this issue Aug 8, 2021 · 4 comments
Open

Comments

@enihcam
Copy link

enihcam commented Aug 8, 2021

  CC [M]  net/netfilter/xt_FULLCONENAT.o
net/netfilter/xt_FULLCONENAT.c:339:52: warning: ‘struct nf_ct_event’ declared inside parameter list will not be
 visible outside of this definition or declaration
  339 | static int ct_event_cb(unsigned int events, struct nf_ct_event *item) {
      |                                                    ^~~~~~~~~~~
net/netfilter/xt_FULLCONENAT.c: In function ‘ct_event_cb’:
net/netfilter/xt_FULLCONENAT.c:346:12: error: invalid use of undefined type ‘struct nf_ct_event’
  346 |   ct = item->ct;
      |            ^~
net/netfilter/xt_FULLCONENAT.c: In function ‘fullconenat_tg_check’:
net/netfilter/xt_FULLCONENAT.c:648:22: error: invalid use of undefined type ‘struct nf_ct_event_notifier’
  648 |     ct_event_notifier.fcn = ct_event_cb;
      |                      ^
net/netfilter/xt_FULLCONENAT.c:651:9: error: implicit declaration of function ‘nf_conntrack_register_notifier’;
 did you mean ‘netlink_register_notifier’? [-Werror=implicit-function-declaration]
  651 |     if (nf_conntrack_register_notifier(par->net, &ct_event_notifier) == 0) {
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         netlink_register_notifier
net/netfilter/xt_FULLCONENAT.c: In function ‘fullconenat_tg_destroy’:
net/netfilter/xt_FULLCONENAT.c:675:7: error: implicit declaration of function ‘nf_conntrack_unregister_notifier
’; did you mean ‘netlink_unregister_notifier’? [-Werror=implicit-function-declaration]
  675 |       nf_conntrack_unregister_notifier(par->net, &ct_event_notifier);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |       netlink_unregister_notifier
net/netfilter/xt_FULLCONENAT.c: At top level:
net/netfilter/xt_FULLCONENAT.c:91:29: error: storage size of ‘ct_event_notifier’ isn’t known
   91 | struct nf_ct_event_notifier ct_event_notifier;
      |                             ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:273: net/netfilter/xt_FULLCONENAT.o] Error 1
make[1]: *** [scripts/Makefile.build:516: net/netfilter] Error 2
make: *** [Makefile:1854: net] Error 2

Anyone?

@FerdiScholten
Copy link

Also fails to build on my system, haven't had time to find out why.

@FerdiScholten
Copy link

Exactly the same output as enihcam in my buildconsole

@Kayuii
Copy link

Kayuii commented May 30, 2022

make netfilter-full-cone-nat in ubuntu 22.04TLS

make -C /lib/modules/5.15.0-30-generic/build M=/root/fullcone/netfilter-full-cone-nat modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-30-generic'
  CC [M]  /root/fullcone/netfilter-full-cone-nat/xt_FULLCONENAT.o
/root/fullcone/netfilter-full-cone-nat/xt_FULLCONENAT.c: In function ‘fullconenat_tg_check’:
/root/fullcone/netfilter-full-cone-nat/xt_FULLCONENAT.c:648:22: error: ‘struct nf_ct_event_notifier’ has no member named ‘fcn’
  648 |     ct_event_notifier.fcn = ct_event_cb;
      |                      ^
/root/fullcone/netfilter-full-cone-nat/xt_FULLCONENAT.c:651:9: error: void value not ignored as it ought to be
  651 |     if (nf_conntrack_register_notifier(par->net, &ct_event_notifier) == 0) {
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/fullcone/netfilter-full-cone-nat/xt_FULLCONENAT.c: In function ‘fullconenat_tg_destroy’:
/root/fullcone/netfilter-full-cone-nat/xt_FULLCONENAT.c:675:7: error: too many arguments to function ‘nf_conntrack_unregister_notifier’
  675 |       nf_conntrack_unregister_notifier(par->net, &ct_event_notifier);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/net/netfilter/nf_conntrack_core.h:18,
                 from /root/fullcone/netfilter-full-cone-nat/xt_FULLCONENAT.c:28:
./include/net/netfilter/nf_conntrack_ecache.h:88:6: note: declared here
   88 | void nf_conntrack_unregister_notifier(struct net *net);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:285: /root/fullcone/netfilter-full-cone-nat/xt_FULLCONENAT.o] Error 1
make[1]: *** [Makefile:1875: /root/fullcone/netfilter-full-cone-nat] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-30-generic'
make: *** [Makefile:5: all] Error 2

@vincenthsing
Copy link

same here~

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

4 participants