Skip to contentSkip to conversation

netfilter Kconfig dependency nightmare

HELP Harald Welte 3 participants 6 messages Sep 17, 2005 4 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#4 lore raw
In reply to a message not in the archive
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_NETLINK NETFILTER_NETLINK IP_NF_CONNTRACK_NETLINK Warning! Found recursive dependency: NETFILTER_NETLINK IP_NF_CONNTRACK_NETLINK NETFILTER_NETLINK NETFILTER_NETLINK_QUEUE

This 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
#5 lore raw

Hi,

Quoted 7 lines · Harald Welte

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

Where is the requirement for the last one coming from?

Quoted 11 lines

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

That looks like a normal ip_conntrack && nfnetlink.

bye, Roman

#6 lore raw
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_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

Where 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
#7 lore raw

Hi,

Quoted 10 lines · Harald Welte

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

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

#8 lore raw
Quoted 2 lines · Roman Zippel

Since IP_NF_CONNTRACK_NETLINK is 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
#9 lore raw
Quoted 9 lines · Harald Welte
Quoted 2 lines · Roman Zippel

Since IP_NF_CONNTRACK_NETLINK is 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