Skip to contentSkip to conversation

Don't export common symbols from ipfwadm.ko

PATCH New Olaf Kirch 1 participant 1 message Oct 7, 2004

Subsystems (2)
lore
Share & tools
lore

Olaf Kirch

author
#0 lore raw

PATCH 1/1 Don't export common symbols from ipfwadm.ko

Hi all,

As of 2.6.9-rc2, two symbols additional symbols (ip_conntrack_count and ip_conntrack_tcp_update). These are exported from conntrack*c files linked into both ip_conntrack.ko and ipfwadm.ko, so the symbols show up both in ip_conntrack.ko and ipfwadm.ko, causing bogus dependencies in modules.dep. The patch below moves the EXPORT_SYMBOL() statements to ip_conntrack_standalone.c.

Cheers
Olaf

Signature · 3 lines
Olaf Kirch     | Things that make Monday morning interesting, #1:
[email protected]   |        "I want to use NFS over AX25, can you help me?"
---------------+ 

Exported kernel symbols ip_conntrack_count and ip_conntrack_tcp_update were showing up both in ip_conntrack.ko and ipfwadm.ko, causing bogus dependencies in modules.dep. The patch below moves the EXPORT_SYMBOL() statements to ip_conntrack_standalone.c.

net/ipv4/netfilter/ip_conntrack_core.c +0 -1
Index: linux-2.6.8/net/ipv4/netfilter/ip_conntrack_core.c
===================================================================
@@ -62,7 +62,6 @@
 
 /* ip_conntrack_standalone needs this */
 atomic_t ip_conntrack_count = ATOMIC_INIT(0);
-EXPORT_SYMBOL(ip_conntrack_count);
 
 void (*ip_conntrack_destroyed)(struct ip_conntrack *conntrack) = NULL;
 LIST_HEAD(ip_conntrack_expect_list);
net/ipv4/netfilter/ip_conntrack_proto_tcp.c +0 -1
Index: linux-2.6.8/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
===================================================================
@@ -737,7 +737,6 @@
 	return 1;
 }
  
-EXPORT_SYMBOL(ip_conntrack_tcp_update);
 #endif
 
 #define	TH_FIN	0x01
net/ipv4/netfilter/ip_conntrack_standalone.c +8 -0
Index: linux-2.6.8/net/ipv4/netfilter/ip_conntrack_standalone.c
===================================================================
@@ -46,6 +46,14 @@
 MODULE_LICENSE("GPL");
 
 extern atomic_t ip_conntrack_count;
+/* We export these symbols here rather than where they're defined
+ * to prevent them from showing up in ipfwadm.ko
+ */
+EXPORT_SYMBOL(ip_conntrack_count);
+#ifdef CONFIG_IP_NF_NAT_NEEDED
+EXPORT_SYMBOL(ip_conntrack_tcp_update);
+#endif
+
 DECLARE_PER_CPU(struct ip_conntrack_stat, ip_conntrack_stat);
 
 unsigned int ip_ct_log_invalid = 0;