Re: test13pre2 - netfilter modiles compile failure

From: Harald Welte (laforge@gnumonks.org)
Date: Sat Dec 16 2000 - 08:09:41 EST


On Sat, Dec 16, 2000 at 11:57:05AM +0100, Harald Welte wrote:
>
> As no other netfilter core team member responded yet, I'm going to provide
> a patch for the 'true library' solution.

well... the 'true library' doesn't make sense, because of the exclusiveness.
In any case there's only one instance of ip_fw_compat inside the kernel:

- ipchains compiled in (ipfwadm option vanishes in 'make menuconfig')
- ipfwadm compiled in (ipchains option vanishes in 'make menuconfig')
- ipchains module loaded: you can't load ipfwadm module
- ipfwadm module loaded: you can't load ipchains module

anyway... here is a patch, which makes the stuff compile and link in all
the combinations I've tried so far. (Please leave the comments, because
we could use them from our patch-o-matic system)

--- linux/net/ipv4/netfilter/Makefile Sat Dec 16 11:59:05 2000
+++ linux-fwcompat/net/ipv4/netfilter/Makefile Sat Dec 16 15:03:02 2000
@@ -14,15 +14,38 @@
 # Multipart objects.
 list-multi := ip_conntrack.o iptable_nat.o ipfwadm.o ipchains.o
 
-ip_conntrack-objs := ip_conntrack_standalone.o ip_conntrack_core.o ip_conntrack_proto_generic.o ip_conntrack_proto_tcp.o ip_conntrack_proto_udp.o ip_conntrack_proto_icmp.o
-iptable_nat-objs := ip_nat_standalone.o ip_nat_rule.o ip_nat_core.o ip_nat_proto_unknown.o ip_nat_proto_tcp.o ip_nat_proto_udp.o ip_nat_proto_icmp.o
-ip_nf_compat-objs := ipfwadm_core.o ip_fw_compat.o ip_fw_compat_redir.o ip_fw_compat_masq.o $(ip_conntrack-objs) $(iptable_nat-objs)
-ipfwadm-objs := ipfwadm_core.o
-ipchains-objs := ipchains_core.o
+# objects for the conntrack and NAT core (used by standalone and backw. compat)
+ip_nf_conntrack-objs := ip_conntrack_core.o ip_conntrack_proto_generic.o ip_conntrack_proto_tcp.o ip_conntrack_proto_udp.o ip_conntrack_proto_icmp.o
+ip_nf_nat-objs := ip_nat_core.o ip_nat_proto_unknown.o ip_nat_proto_tcp.o ip_nat_proto_udp.o ip_nat_proto_icmp.o
 
+# objects for the standalone - connection tracking / NAT
+ip_conntrack-objs := ip_conntrack_standalone.o $(ip_nf_conntrack-objs)
+iptable_nat-objs := ip_nat_standalone.o ip_nat_rule.o $(ip_nf_nat-objs)
+
+# objects for backwards compatibility mode
+ip_nf_compat-objs := ip_fw_compat.o ip_fw_compat_redir.o ip_fw_compat_masq.o $(ip_nf_conntrack-objs) $(ip_nf_nat-objs)
+
+ipfwadm-objs := $(ip_nf_compat-objs) ipfwadm_core.o
+ipchains-objs := $(ip_nf_compat-objs) ipchains_core.o
+
+# connection tracking
 obj-$(CONFIG_IP_NF_CONNTRACK) += ip_conntrack.o
+
+# connection tracking helpers
 obj-$(CONFIG_IP_NF_FTP) += ip_conntrack_ftp.o
+
+# NAT helpers
+obj-$(CONFIG_IP_NF_FTP) += ip_nat_ftp.o
+
+# generic IP tables
 obj-$(CONFIG_IP_NF_IPTABLES) += ip_tables.o
+
+# the three instances of ip_tables
+obj-$(CONFIG_IP_NF_FILTER) += iptable_filter.o
+obj-$(CONFIG_IP_NF_MANGLE) += iptable_mangle.o
+obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o
+
+# matches
 obj-$(CONFIG_IP_NF_MATCH_LIMIT) += ipt_limit.o
 obj-$(CONFIG_IP_NF_MATCH_MARK) += ipt_mark.o
 obj-$(CONFIG_IP_NF_MATCH_MAC) += ipt_mac.o
@@ -31,11 +54,8 @@
 obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o
 obj-$(CONFIG_IP_NF_MATCH_STATE) += ipt_state.o
 obj-$(CONFIG_IP_NF_MATCH_UNCLEAN) += ipt_unclean.o
-obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o
-obj-$(CONFIG_IP_NF_FTP) += ip_nat_ftp.o
-obj-$(CONFIG_IP_NF_FILTER) += iptable_filter.o
-obj-$(CONFIG_IP_NF_MANGLE) += iptable_mangle.o
 
+# targets
 obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
 obj-$(CONFIG_IP_NF_TARGET_MIRROR) += ipt_MIRROR.o
 obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o
@@ -44,8 +64,10 @@
 obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
 obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o
 
-obj-$(CONFIG_IP_NF_COMPAT_IPCHAINS) += ipchains.o ip_nf_compat.o
-obj-$(CONFIG_IP_NF_COMPAT_IPFWADM) += ipfwadm.o ip_nf_compat.o
+# backwards compatibility
+obj-$(CONFIG_IP_NF_COMPAT_IPCHAINS) += ipchains.o
+obj-$(CONFIG_IP_NF_COMPAT_IPFWADM) += ipfwadm.o
+
 obj-$(CONFIG_IP_NF_QUEUE) += ip_queue.o
 
 include $(TOPDIR)/Rules.make
@@ -61,6 +83,3 @@
 
 ipchains.o: $(ipchains-objs)
         $(LD) -r -o $@ $(ipchains-objs)
-
-ip_nf_compat.o: $(ip_nf_compat-objs)
- $(LD) -r -o $@ $(ip_nf_compat-objs)

-- 
Live long and prosper
- Harald Welte / laforge@gnumonks.org                http://www.gnumonks.org
============================================================================
GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M- 
V-- PS+ PE-- Y+ PGP++ t++ 5-- !X !R tv-- b+++ DI? !D G+ e* h+ r% y+(*)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Dec 23 2000 - 21:00:15 EST