netfilter Kconfig dependency nightmare
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · Arnaldo Carvalho de Melo
After applying this patch I still get a loop:
[acme@toy net-2.6]$ make O=OUTPUT/oops/ oldconfig | grep Warning
Warning! Found recursive dependency:IP_NF_CONNTRACK_NETLINKNETFILTER_NETLINKIP_NF_CONNTRACK_NETLINKWarning! Found recursive dependency:NETFILTER_NETLINKIP_NF_CONNTRACK_NETLINKNETFILTER_NETLINKNETFILTER_NETLINK_QUEUEThis is using latest Dave tree, the one just before master.kernel.org was switched off for moving to Oregon, is there any other patch I should apply?
This f!*#$%!#$%ing kconfig dependency is killing me. We have this
incredible inter-dependency between various options, and with every new feature it's getting more complex. The main reason being to avoid some bits of dead code in case it's not really needed by some other module.
I'm starting to wonder whether it's really worth saving those few bytes in some configurations at the expense of this complexity.
Maybe some Kconfig freak can help out. This is the intended dependency rules:
ip_conntrack == CONFIG_IP_NF_CONNTRACK nfnetlink == CONFIG_NETFILTER_NETLINK ip_conntrack_netlink == CONFIG_IP_NF_CONNTRACK_NETLINK
If nfnetlink == N, ip_conntrack can be N or M or Y If nfnetlink == M, ip_conntrack can be N or M If nfnetlink == Y, ip_conntrack can be Y or M
If ip_conntrack == N && nfnetlink == N, ip_conntrack_netlink must be N If ip_conntrack == N && nfnetlink == M, ip_conntrack_netlink must be N If ip_conntrack == N && nfnetlink == Y, ip_conntrack_netlink must be N
If ip_conntrack == M && nfnetlink == N, ip_conntrack_netlink must be N If ip_conntrack == M && nfnetlink == M, ip_conntrack_netlink can N or M If ip_conntrack == M && nfnetlink == Y, ip_conntrack_netlink can N or M
if ip_conntrack == Y && nfnetlink == N, ip_conntrack_netlink must be N if ip_conntrack == Y && nfnetlink == M, ip_conntrack_netlink can N or M if ip_conntrack == Y && nfnetlink == Y, ip_conntrack_netlink can N, M or Y
NETfILTER_NETLINK_QUEUE and NETFILTER_NETLINK_LOG only depend on NETFILER_NETLINK and nothing else.
Cheers,
Signature · 5 lines
- Harald Welte <[email protected]> http://netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
Hi,
Quoted 7 lines · Harald Welte
ip_conntrack==CONFIG_IP_NF_CONNTRACKnfnetlink ==CONFIG_NETFILTER_NETLINKip_conntrack_netlink==CONFIG_IP_NF_CONNTRACK_NETLINKIf nfnetlink == N,
ip_conntrackcan be N or M or Y If nfnetlink == M,ip_conntrackcan be N or M If nfnetlink == Y,ip_conntrackcan be Y or M
Where is the requirement for the last one coming from?
Quoted 11 lines
If
ip_conntrack== N && nfnetlink == N,ip_conntrack_netlinkmust be N Ifip_conntrack== N && nfnetlink == M,ip_conntrack_netlinkmust be N Ifip_conntrack== N && nfnetlink == Y,ip_conntrack_netlinkmust be NIf
ip_conntrack== M && nfnetlink == N,ip_conntrack_netlinkmust be N Ifip_conntrack== M && nfnetlink == M,ip_conntrack_netlinkcan N or M Ifip_conntrack== M && nfnetlink == Y,ip_conntrack_netlinkcan N or Mif
ip_conntrack== Y && nfnetlink == N,ip_conntrack_netlinkmust be N ifip_conntrack== Y && nfnetlink == M,ip_conntrack_netlinkcan N or M ifip_conntrack== Y && nfnetlink == Y,ip_conntrack_netlinkcan N, M or Y
That looks like a normal ip_conntrack && nfnetlink.
bye, Roman
Quoted 1 line · Roman Zippel
Hi,
Hi Roman, thanks for your reply.
Quoted 11 lines · Harald Welte
Quoted 8 lines
ip_conntrack==CONFIG_IP_NF_CONNTRACKnfnetlink ==CONFIG_NETFILTER_NETLINKip_conntrack_netlink==CONFIG_IP_NF_CONNTRACK_NETLINKIf nfnetlink == N,
ip_conntrackcan be N or M or Y If nfnetlink == M,ip_conntrackcan be N or M If nfnetlink == Y,ip_conntrackcan be Y or MWhere is the requirement for the last one coming from?
sorry. The last one should be N,M or Y.
The fundamental underlying problem is:
If CONFIG_IP_NF_CONNTRACK_NETLINK is selected (M or Y), then CONFIG_IP_NF_CONNTRACK conditionally adds some code that references symbols from nfnetlink.ko (CONFIG_NETFILTER_NETLINK)
So basically, enabling CONFIG_IP_NF_CONNTRACK_NETLINK creates a dependency from CONFIG_IP_NF_CONNTRACK to CONFIG_NETFILTER_NETLINK. AFAIK, the syntax doesn't allow somthing like
tristate IP_NF_CONNTRACK
depends on NETFILTER_NETLINK if IP_NF_CONNTRACK_NETLINK!=n
So, if ip_conntrack_netlink == M (or Y), and ip_conntrack == Y, then nfnetlink has to be set to Y (but cannot be a module).
Is there something that resembles
And no, I do not see any chance to solve the problem in the code, without either
1) adding yet another new module that only contains some 1kB of code and that requires additional EXPORT_SYMBOLS() on private data from ip_conntrack
or
2) adding dead code to ip_conntrack.ko that isn't used in many common configurations
:(
Signature · 5 lines
- Harald Welte <[email protected]> http://netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
Hi,
Quoted 10 lines · Harald Welte
If
CONFIG_IP_NF_CONNTRACK_NETLINKis selected (M or Y), thenCONFIG_IP_NF_CONNTRACKconditionally adds some code that references symbols from nfnetlink.ko (CONFIG_NETFILTER_NETLINK)So basically, enabling
CONFIG_IP_NF_CONNTRACK_NETLINKcreates a dependency fromCONFIG_IP_NF_CONNTRACKtoCONFIG_NETFILTER_NETLINK. AFAIK, the syntax doesn't allow somthing liketristate
IP_NF_CONNTRACKdepends on NETFILTER_NETLINK if IP_NF_CONNTRACK_NETLINK!=n
Since IP_NF_CONNTRACK_NETLINK is the one creating the dependency, something like this should work:
config IP_NF_CONNTRACK_NETLINK
depends on IP_NF_CONNTRACK && NETFILTER_NETLINK depends on IP_NF_CONNTRACK!=y || NETFILTER_NETLINK!=m
IOW ct_nl depends on (ct && nl) unless (ct=y && nl=m).
bye, Roman
Quoted 2 lines · Roman Zippel
Since
IP_NF_CONNTRACK_NETLINKis the one creating the dependency, something like this should work:
yes, I agree. Looking at the behaviour of "menuconfig", I think your suggestion solves the problem. I didn't try to compile all the combinations, though.
I'll submit a patch via DaveM soon.
Signature · 5 lines
- Harald Welte <[email protected]> http://netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
Quoted 9 lines · Harald Welte
Quoted 2 lines · Roman Zippel
Since
IP_NF_CONNTRACK_NETLINKis the one creating the dependency, something like this should work:yes, I agree. Looking at the behaviour of "menuconfig", I think your suggestion solves the problem. I didn't try to compile all the combinations, though.
I'll submit a patch via DaveM soon.
OK, I'll test it as soon as it appears here :-)
- Arnaldo