linux icon indicating copy to clipboard operation
linux copied to clipboard

Setting CONFIG_NETFILTER_XT_TARGET_FULLCONENAT leads to build failure in 5.15.7

Open BGazotti opened this issue 2 years ago • 2 comments

This seems to be a new config option in 5.15.7, but when selected, the compiler errors out in the corresponding file. Relevant error messages below:

net/netfilter/xt_FULLCONENAT.c: In function ‘fullconenat_tg6’:
net/netfilter/xt_FULLCONENAT.c:497:12: error: ‘struct nf_conn_nat’ has no member named ‘masq_ind
ex’
  497 |         nat->masq_index = xt_out(par)->ifindex;
      |            ^~
net/netfilter/xt_FULLCONENAT.c: At top level:
net/netfilter/xt_FULLCONENAT.c:898:58: warning: ‘struct nf_ct_event’ declared inside parameter l
ist will not be visible outside of this definition or declaration
  898 | static int ct_event_cb(unsigned int events, const struct nf_ct_event *item) {
      |                                                          ^~~~~~~~~~~
net/netfilter/xt_FULLCONENAT.c: In function ‘ct_event_cb’:
net/netfilter/xt_FULLCONENAT.c:907:12: error: invalid use of undefined type ‘const struct nf_ct_
event’
  907 |   ct = item->ct;
      |            ^~
net/netfilter/xt_FULLCONENAT.c: At top level:
net/netfilter/xt_FULLCONENAT.c:945:59: warning: ‘struct nf_exp_event’ declared inside parameter 
list will not be visible outside of this definition or declaration
  945 | static int exp_event_cb(unsigned int events, const struct nf_exp_event *item) {
      |                                                           ^~~~~~~~~~~~
net/netfilter/xt_FULLCONENAT.c: In function ‘fullconenat_tg’:
net/netfilter/xt_FULLCONENAT.c:1156:12: error: ‘struct nf_conn_nat’ has no member named ‘masq_in
dex’
 1156 |         nat->masq_index = xt_out(par)->ifindex;
      |            ^~
net/netfilter/xt_FULLCONENAT.c: In function ‘fullconenat_tg_check’:
net/netfilter/xt_FULLCONENAT.c:1254:22: error: invalid use of undefined type ‘struct nf_ct_event
_notifier’
 1254 |     ct_event_notifier.ct_event = ct_event_cb;
      |                      ^
net/netfilter/xt_FULLCONENAT.c:1255:22: error: invalid use of undefined type ‘struct nf_ct_event
_notifier’
 1255 |     ct_event_notifier.exp_event = exp_event_cb;
      |                      ^
net/netfilter/xt_FULLCONENAT.c:1261:5: error: implicit declaration of function ‘nf_conntrack_register_notifier’; did you mean ‘netlink_register_notifier’? [-Werror=implicit-function-declaration]
 1261 |     nf_conntrack_register_notifier(par->net, &ct_event_notifier);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     netlink_register_notifier
net/netfilter/xt_FULLCONENAT.c: In function ‘fullconenat_tg_destroy’:
net/netfilter/xt_FULLCONENAT.c:1290:7: error: implicit declaration of function ‘nf_conntrack_unregister_notifier’; did you mean ‘netlink_unregister_notifier’? [-Werror=implicit-function-declaration]
 1290 |       nf_conntrack_unregister_notifier(par->net);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |       netlink_unregister_notifier
net/netfilter/xt_FULLCONENAT.c: At top level:
net/netfilter/xt_FULLCONENAT.c:123:29: error: storage size of ‘ct_event_notifier’ isn’t known
  123 | struct nf_ct_event_notifier ct_event_notifier;
      |                             ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

Using GCC 11.2.1 to build. No added CFLAGS or LDFLAGS.

Full build log: buildlog-5.15.7.log

Config: testconfig-5.15.7.txt

BGazotti avatar Dec 09 '21 13:12 BGazotti

Oopsie. Had Gentoo patches applied on top of XanMod for that build. Anyway, the same warnings and errors pop out on 5.15.7-tt, no other patches applied.

Build log: xanmod-5.15.7.log

Config: testconfig-5.15.7.txt

BGazotti avatar Dec 09 '21 14:12 BGazotti

Missing setting in IP: Netfilter Configuration

should look something like this config: https://github.com/xanmod/linux/commit/866cc62fa34a5f51b8b584f66d3361bb1bea94a7

https://github.com/xanmod/linux-patches/tree/master/linux-5.15.y-xanmod/netfilter

xanmod avatar Dec 09 '21 22:12 xanmod