kernel: add @IPV6 dependency to ipv6 modules

IPv6 modules should all depend on @IPV6, to avoid circular dependencies
problems, especially if they select a module that depends on IPV6 as
well.  In theory, if a package A depends on IPV6, any package doing
'select A' (DEPENDS+= A) should also depend on IPV6; otherwise selecting
A will fail.  Sometimes the build system is forgiving this, but
eventually, and unexpectedly, it may blow up on some other commit.

Alternatively one can conditionally add IPv6 dependencies only if
CONFIG_IPV6 is selected: (DEPENDS+= +IPV6:package6).

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This commit is contained in:
Eneas U de Queiroz 2020-04-07 17:07:19 -03:00 committed by Petr Štetiar
parent 4627b5df69
commit 2e6b6f9fca
2 changed files with 11 additions and 8 deletions

View File

@ -137,7 +137,7 @@ define KernelPackage/nf-nat6
SUBMENU:=$(NF_MENU) SUBMENU:=$(NF_MENU)
TITLE:=Netfilter IPV6-NAT TITLE:=Netfilter IPV6-NAT
KCONFIG:=$(KCONFIG_NF_NAT6) KCONFIG:=$(KCONFIG_NF_NAT6)
DEPENDS:=+kmod-nf-conntrack6 +kmod-nf-nat DEPENDS:=@IPV6 +kmod-nf-conntrack6 +kmod-nf-nat
FILES:=$(foreach mod,$(NF_NAT6-m),$(LINUX_DIR)/net/$(mod).ko) FILES:=$(foreach mod,$(NF_NAT6-m),$(LINUX_DIR)/net/$(mod).ko)
AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_NAT6-m))) AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_NAT6-m)))
endef endef
@ -471,6 +471,7 @@ $(eval $(call KernelPackage,ipt-raw))
define KernelPackage/ipt-raw6 define KernelPackage/ipt-raw6
TITLE:=Netfilter IPv6 raw table support TITLE:=Netfilter IPv6 raw table support
DEPENDS:=@IPV6
KCONFIG:=CONFIG_IP6_NF_RAW KCONFIG:=CONFIG_IP6_NF_RAW
FILES:=$(LINUX_DIR)/net/ipv6/netfilter/ip6table_raw.ko FILES:=$(LINUX_DIR)/net/ipv6/netfilter/ip6table_raw.ko
AUTOLOAD:=$(call AutoProbe,ip6table_raw) AUTOLOAD:=$(call AutoProbe,ip6table_raw)
@ -482,6 +483,7 @@ $(eval $(call KernelPackage,ipt-raw6))
define KernelPackage/ipt-nat6 define KernelPackage/ipt-nat6
TITLE:=IPv6 NAT targets TITLE:=IPv6 NAT targets
DEPENDS:=@IPV6
KCONFIG:=$(KCONFIG_IPT_NAT6) KCONFIG:=$(KCONFIG_IPT_NAT6)
FILES:=$(foreach mod,$(IPT_NAT6-m),$(LINUX_DIR)/net/$(mod).ko) FILES:=$(foreach mod,$(IPT_NAT6-m),$(LINUX_DIR)/net/$(mod).ko)
AUTOLOAD:=$(call AutoLoad,43,$(notdir $(IPT_NAT6-m))) AUTOLOAD:=$(call AutoLoad,43,$(notdir $(IPT_NAT6-m)))
@ -806,7 +808,7 @@ $(eval $(call KernelPackage,ipt-physdev))
define KernelPackage/ip6tables define KernelPackage/ip6tables
SUBMENU:=$(NF_MENU) SUBMENU:=$(NF_MENU)
TITLE:=IPv6 modules TITLE:=IPv6 modules
DEPENDS:=+kmod-nf-reject6 +kmod-nf-ipt6 +kmod-ipt-core DEPENDS:=@IPV6 +kmod-nf-reject6 +kmod-nf-ipt6 +kmod-ipt-core
KCONFIG:=$(KCONFIG_IPT_IPV6) KCONFIG:=$(KCONFIG_IPT_IPV6)
FILES:=$(foreach mod,$(IPT_IPV6-m),$(LINUX_DIR)/net/$(mod).ko) FILES:=$(foreach mod,$(IPT_IPV6-m),$(LINUX_DIR)/net/$(mod).ko)
AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_IPV6-m))) AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_IPV6-m)))
@ -821,7 +823,7 @@ $(eval $(call KernelPackage,ip6tables))
define KernelPackage/ip6tables-extra define KernelPackage/ip6tables-extra
SUBMENU:=$(NF_MENU) SUBMENU:=$(NF_MENU)
TITLE:=Extra IPv6 modules TITLE:=Extra IPv6 modules
DEPENDS:=+kmod-ip6tables DEPENDS:=@IPV6 +kmod-ip6tables
KCONFIG:=$(KCONFIG_IPT_IPV6_EXTRA) KCONFIG:=$(KCONFIG_IPT_IPV6_EXTRA)
FILES:=$(foreach mod,$(IPT_IPV6_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko) FILES:=$(foreach mod,$(IPT_IPV6_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
AUTOLOAD:=$(call AutoLoad,43,$(notdir $(IPT_IPV6_EXTRA-m))) AUTOLOAD:=$(call AutoLoad,43,$(notdir $(IPT_IPV6_EXTRA-m)))
@ -911,6 +913,7 @@ $(eval $(call KernelPackage,ebtables-ipv4))
define KernelPackage/ebtables-ipv6 define KernelPackage/ebtables-ipv6
TITLE:=ebtables: IPv6 support TITLE:=ebtables: IPv6 support
DEPENDS:=@IPV6
FILES:=$(foreach mod,$(EBTABLES_IP6-m),$(LINUX_DIR)/net/$(mod).ko) FILES:=$(foreach mod,$(EBTABLES_IP6-m),$(LINUX_DIR)/net/$(mod).ko)
KCONFIG:=$(KCONFIG_EBTABLES_IP6) KCONFIG:=$(KCONFIG_EBTABLES_IP6)
AUTOLOAD:=$(call AutoProbe,$(notdir $(EBTABLES_IP6-m))) AUTOLOAD:=$(call AutoProbe,$(notdir $(EBTABLES_IP6-m)))
@ -1049,7 +1052,7 @@ $(eval $(call KernelPackage,ipt-rpfilter))
define KernelPackage/nft-core define KernelPackage/nft-core
SUBMENU:=$(NF_MENU) SUBMENU:=$(NF_MENU)
TITLE:=Netfilter nf_tables support TITLE:=Netfilter nf_tables support
DEPENDS:=+kmod-nfnetlink +kmod-nf-reject +kmod-nf-reject6 +kmod-nf-conntrack6 +LINUX_5_4:kmod-nf-nat DEPENDS:=+kmod-nfnetlink +kmod-nf-reject +IPV6:kmod-nf-reject6 +IPV6:kmod-nf-conntrack6 +LINUX_5_4:kmod-nf-nat
FILES:=$(foreach mod,$(NFT_CORE-m),$(LINUX_DIR)/net/$(mod).ko) FILES:=$(foreach mod,$(NFT_CORE-m),$(LINUX_DIR)/net/$(mod).ko)
AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_CORE-m))) AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_CORE-m)))
KCONFIG:= \ KCONFIG:= \
@ -1106,7 +1109,7 @@ $(eval $(call KernelPackage,nft-nat))
define KernelPackage/nft-offload define KernelPackage/nft-offload
SUBMENU:=$(NF_MENU) SUBMENU:=$(NF_MENU)
TITLE:=Netfilter nf_tables routing/NAT offload support TITLE:=Netfilter nf_tables routing/NAT offload support
DEPENDS:=+kmod-nf-flow +kmod-nft-nat DEPENDS:=@IPV6 +kmod-nf-flow +kmod-nft-nat
KCONFIG:= \ KCONFIG:= \
CONFIG_NF_FLOW_TABLE_INET \ CONFIG_NF_FLOW_TABLE_INET \
CONFIG_NF_FLOW_TABLE_IPV4 \ CONFIG_NF_FLOW_TABLE_IPV4 \

View File

@ -318,7 +318,7 @@ IPSEC6-m += $(ifeq ($$(strip $$(call CompareKernelPatchVer,$$(KERNEL_PATCHVER),l
define KernelPackage/ipsec6 define KernelPackage/ipsec6
SUBMENU:=$(NETWORK_SUPPORT_MENU) SUBMENU:=$(NETWORK_SUPPORT_MENU)
TITLE:=IPsec related modules (IPv6) TITLE:=IPsec related modules (IPv6)
DEPENDS:=kmod-ipsec +kmod-iptunnel6 DEPENDS:=@IPV6 kmod-ipsec +kmod-iptunnel6
KCONFIG:= \ KCONFIG:= \
CONFIG_INET6_AH \ CONFIG_INET6_AH \
CONFIG_INET6_ESP \ CONFIG_INET6_ESP \
@ -383,7 +383,7 @@ $(eval $(call KernelPackage,ip-vti))
define KernelPackage/ip6-vti define KernelPackage/ip6-vti
SUBMENU:=$(NETWORK_SUPPORT_MENU) SUBMENU:=$(NETWORK_SUPPORT_MENU)
TITLE:=IPv6 VTI (Virtual Tunnel Interface) TITLE:=IPv6 VTI (Virtual Tunnel Interface)
DEPENDS:=+kmod-iptunnel +kmod-ip6-tunnel +kmod-ipsec6 DEPENDS:=@IPV6 +kmod-iptunnel +kmod-ip6-tunnel +kmod-ipsec6
KCONFIG:=CONFIG_IPV6_VTI KCONFIG:=CONFIG_IPV6_VTI
FILES:=$(LINUX_DIR)/net/ipv6/ip6_vti.ko FILES:=$(LINUX_DIR)/net/ipv6/ip6_vti.ko
AUTOLOAD:=$(call AutoLoad,33,ip6_vti) AUTOLOAD:=$(call AutoLoad,33,ip6_vti)
@ -399,7 +399,7 @@ $(eval $(call KernelPackage,ip6-vti))
define KernelPackage/xfrm-interface define KernelPackage/xfrm-interface
SUBMENU:=$(NETWORK_SUPPORT_MENU) SUBMENU:=$(NETWORK_SUPPORT_MENU)
TITLE:=IPsec XFRM Interface TITLE:=IPsec XFRM Interface
DEPENDS:=+kmod-ipsec4 +kmod-ipsec6 @!LINUX_4_14 DEPENDS:=+kmod-ipsec4 +@IPV6:kmod-ipsec6 @!LINUX_4_14
KCONFIG:=CONFIG_XFRM_INTERFACE KCONFIG:=CONFIG_XFRM_INTERFACE
FILES:=$(LINUX_DIR)/net/xfrm/xfrm_interface.ko FILES:=$(LINUX_DIR)/net/xfrm/xfrm_interface.ko
AUTOLOAD:=$(call AutoProbe,xfrm_interface) AUTOLOAD:=$(call AutoProbe,xfrm_interface)