Some netfilter compile errors when CONFIG_IPV6=m
Subsystems (3)
Hi, all
I got the following compile errors when I compile IPv6 as a module and most of the rest are built into core kernel. David Miller insists we should fix this kind of error and not by adding Kconfig tricks.
net/built-in.o: In function `nf_tproxy_get_sock_v6':/home/wangcong/linux/include/net/netfilter/nf_tproxy_core.h:177:
undefined reference to `udp6_lib_lookup' /home/wangcong/linux/include/net/netfilter/nf_tproxy_core.h:177:
undefined reference to `udp6_lib_lookup'net/built-in.o: In function `tproxy_tg_init':/home/wangcong/linux/net/netfilter/xt_TPROXY.c:415: undefined reference to `nf_defrag_ipv6_enable'net/built-in.o: In function `socket_mt_init':/home/wangcong/linux/net/netfilter/xt_socket.c:366: undefined reference to `nf_defrag_ipv6_enable'
My .config is:
CONFIG_NET_IPGRE=mCONFIG_IPV6=mCONFIG_INET6_AH=mCONFIG_INET6_ESP=mCONFIG_INET6_IPCOMP=mCONFIG_IPV6_MIP6=mCONFIG_INET6_XFRM_TUNNEL=mCONFIG_INET6_TUNNEL=mCONFIG_INET6_XFRM_MODE_TRANSPORT=mCONFIG_INET6_XFRM_MODE_TUNNEL=mCONFIG_INET6_XFRM_MODE_BEET=mCONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=mCONFIG_IPV6_SIT=mCONFIG_IPV6_TUNNEL=mCONFIG_IPV6_GRE=mCONFIG_NF_CONNTRACK_H323=mCONFIG_NETFILTER_XT_TARGET_TEE=mCONFIG_NETFILTER_XT_TARGET_TCPMSS=mCONFIG_NETFILTER_XT_MATCH_HASHLIMIT=mCONFIG_NETFILTER_XT_MATCH_PHYSDEV=mCONFIG_NF_NAT_H323=mCONFIG_NF_DEFRAG_IPV6=mCONFIG_NF_CONNTRACK_IPV6=mCONFIG_IP6_NF_IPTABLES=mCONFIG_IP6_NF_MATCH_AH=mCONFIG_IP6_NF_MATCH_EUI64=mCONFIG_IP6_NF_MATCH_FRAG=mCONFIG_IP6_NF_MATCH_OPTS=mCONFIG_IP6_NF_MATCH_HL=mCONFIG_IP6_NF_MATCH_IPV6HEADER=mCONFIG_IP6_NF_MATCH_MH=mCONFIG_IP6_NF_MATCH_RT=mCONFIG_IP6_NF_TARGET_HL=mCONFIG_IP6_NF_FILTER=mCONFIG_IP6_NF_TARGET_REJECT=mCONFIG_IP6_NF_MANGLE=mCONFIG_IP6_NF_RAW=mCONFIG_IP6_NF_SECURITY=mCONFIG_NF_NAT_IPV6=mCONFIG_IP6_NF_TARGET_MASQUERADE=mCONFIG_BRIDGE_NF_EBTABLES=mCONFIG_BRIDGE_EBT_BROUTE=mCONFIG_BRIDGE_EBT_T_FILTER=mCONFIG_BRIDGE_EBT_T_NAT=mCONFIG_BRIDGE_EBT_802_3=mCONFIG_BRIDGE_EBT_AMONG=mCONFIG_BRIDGE_EBT_ARP=mCONFIG_BRIDGE_EBT_IP=mCONFIG_BRIDGE_EBT_IP6=mCONFIG_BRIDGE_EBT_LIMIT=mCONFIG_BRIDGE_EBT_MARK=mCONFIG_BRIDGE_EBT_PKTTYPE=mCONFIG_BRIDGE_EBT_STP=mCONFIG_BRIDGE_EBT_VLAN=mCONFIG_BRIDGE_EBT_ARPREPLY=mCONFIG_BRIDGE_EBT_DNAT=mCONFIG_BRIDGE_EBT_MARK_T=mCONFIG_BRIDGE_EBT_REDIRECT=mCONFIG_BRIDGE_EBT_SNAT=mCONFIG_BRIDGE_EBT_LOG=mCONFIG_BRIDGE_EBT_ULOG=mCONFIG_BRIDGE_EBT_NFLOG=mCONFIG_IP_SCTP=mCONFIG_BRIDGE=mCONFIG_BONDING=m
all the rest are either =y or =n.
Thanks.
Quoted 6 lines · Cong Wang
net/built-in.o: In function `tproxy_tg_init':/home/wangcong/linux/net/netfilter/xt_TPROXY.c:415: undefined reference to `nf_defrag_ipv6_enable'net/built-in.o: In function `socket_mt_init':/home/wangcong/linux/net/netfilter/xt_socket.c:366: undefined reference to `nf_defrag_ipv6_enable'
I don't know why we keep an empty definition for nf_defrag_ipv6_enable(), so I make a patch to remove it, not sure if it makes sense.
(quoted diff) +0 -0
b/include/net/netfilter/ipv4/nf_defrag_ipv4.h
deleted file mode 100644
index 6b00ea3..0000000
include/net/netfilter/ipv4/nf_defrag_ipv4.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef _NF_DEFRAG_IPV4_H -#define _NF_DEFRAG_IPV4_H - -extern void nf_defrag_ipv4_enable (void ); - -#endif /* _NF_DEFRAG_IPV4_H */
(quoted diff) +0 -0
b/include/net/netfilter/ipv6/nf_defrag_ipv6.h
index fd79c9a..7ba91bb 100644
include/net/netfilter/ipv6/nf_defrag_ipv6.h +0 -2
@@ -1,8 +1,6 @@#ifndef _NF_DEFRAG_IPV6_H#define _NF_DEFRAG_IPV6_H -extern void nf_defrag_ipv6_enable (void ); -extern int nf_ct_frag6_init (void );extern void nf_ct_frag6_cleanup (void ); extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32
user);
(quoted diff) +0 -0
b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index 567d841..7344253 100644
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +0 -1
@@ -27,7 +27,6 @@#include <net/netfilter/nf_conntrack_core.h> #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> #include <net/netfilter/nf_nat_helper.h> -#include <net/netfilter/ipv4/nf_defrag_ipv4.h> #include <net/netfilter/nf_log.h> static bool ipv4_pkt_to_tuple(const struct sk_buff *skb, unsigned int
nhoff,
@@ -464,7 +463,6 @@ static int __initnf_conntrack_l3proto_ipv4_init(void)
int ret = 0;
need_conntrack();
- nf_defrag_ipv4_enable();
ret = nf_register_sockopt(&so_getorigdst); if (ret < 0) {
(quoted diff) +0 -0
b/net/ipv4/netfilter/nf_defrag_ipv4.c
index 7428155..b2ec6f1 100644
net/ipv4/netfilter/nf_defrag_ipv4.c +0 -6
@@ -16,7 +16,6 @@#include <linux/netfilter_bridge.h> #include <linux/netfilter_ipv4.h> -#include <net/netfilter/ipv4/nf_defrag_ipv4.h> #if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )#include <net/netfilter/nf_conntrack.h> #endif
@@ -117,11 +116,6 @@ static void __exit nf_defrag_fini(void)nf_unregister_hooks (ipv4_defrag_ops,ARRAY_SIZE (ipv4_defrag_ops)); } -void nf_defrag_ipv4_enable (void ) -{ -} -EXPORT_SYMBOL_GPL (nf_defrag_ipv4_enable); -module_init (nf_defrag_init);module_exit (nf_defrag_fini);
(quoted diff) +0 -0
b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
index 97bcf2b..3fc4d53 100644
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +0 -0
@@ -460,7 +460,6 @@ static int __init
nf_conntrack_l3proto_ipv6_init(void)
int ret = 0;
need_conntrack();
- nf_defrag_ipv6_enable();
ret = nf_register_sockopt(&so_getorigdst6); if (ret < 0) {
(quoted diff) +0 -0
b/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
index aacd121..97c876f 100644
net/ipv6/netfilter/nf_defrag_ipv6_hooks.c +0 -6
@@ -125,12 +125,6 @@ static void __exit nf_defrag_fini(void)nf_unregister_hooks (ipv6_defrag_ops,ARRAY_SIZE (ipv6_defrag_ops));nf_ct_frag6_cleanup (); } - -void nf_defrag_ipv6_enable (void ) -{ -} -EXPORT_SYMBOL_GPL (nf_defrag_ipv6_enable); -module_init (nf_defrag_init);module_exit (nf_defrag_fini);
net/netfilter/xt_TPROXY.c +0 -2
@@ -20,8 +20,6 @@#include <linux/netfilter/x_tables.h> #include <linux/netfilter_ipv4/ip_tables.h> -#include <net/netfilter/ipv4/nf_defrag_ipv4.h> -#if IS_ENABLED (CONFIG_IP6_NF_IPTABLES )#define XT_TPROXY_HAVE_IPV6 1#include <net/if_inet6.h>
@@ -410,11 +408,6 @@ static struct xt_target tproxy_tg_reg[]
__read_mostly = {
static int __init tproxy_tg_init(void)
{
- nf_defrag_ipv4_enable();
-#ifdef XT_TPROXY_HAVE_IPV6
- nf_defrag_ipv6_enable();
-#endif
-
return xt_register_targets(tproxy_tg_reg, ARRAY_SIZE(tproxy_tg_reg));
}
net/netfilter/xt_socket.c +0 -1
@@ -20,7 +20,6 @@#include <net/sock.h> #include <net/inet_sock.h> #include <net/netfilter/nf_tproxy_core.h> -#include <net/netfilter/ipv4/nf_defrag_ipv4.h> #if IS_ENABLED (CONFIG_IP6_NF_IPTABLES )#define XT_SOCKET_HAVE_IPV6 1
@@ -361,11 +360,6 @@ static struct xt_match socket_mt_reg[]
__read_mostly = {
static int __init socket_mt_init(void)
{
- nf_defrag_ipv4_enable();
-#ifdef XT_SOCKET_HAVE_IPV6
- nf_defrag_ipv6_enable();
-#endif
-
return xt_register_matches(socket_mt_reg, ARRAY_SIZE(socket_mt_reg));
}
Pablo Neira Ayuso
maintainerQuoted 11 lines · Cong Wang
Quoted 6 lines · Cong Wang
net/built-in.o: In function `tproxy_tg_init':/home/wangcong/linux/net/netfilter/xt_TPROXY.c:415: undefined reference to `nf_defrag_ipv6_enable'net/built-in.o: In function `socket_mt_init':/home/wangcong/linux/net/netfilter/xt_socket.c:366: undefined reference to `nf_defrag_ipv6_enable'I don't know why we keep an empty definition for
nf_defrag_ipv6_enable(), so I make a patch to remove it, not sure if it makes sense.
It's there to enforce the dependency between nf_conntrack and nf_defrag. We cannot run nf_conntrack without it.
Cc'ing Bjørn who cares IPV6=m compile errors very much. :)
BTW, this is what I found while testing my vxlan patches with IPV6=m.
Quoted 86 lines · Cong Wang
Hi, all
I got the following compile errors when I compile IPv6 as a module and most of the rest are built into core kernel. David Miller insists we should fix this kind of error and not by adding
Kconfigtricks.
net/built-in.o: In function `nf_tproxy_get_sock_v6':/home/wangcong/linux/include/net/netfilter/nf_tproxy_core.h:177:
undefined reference to `udp6_lib_lookup'/home/wangcong/linux/include/net/netfilter/nf_tproxy_core.h:177:
undefined reference to `udp6_lib_lookup'net/built-in.o: In function `tproxy_tg_init':/home/wangcong/linux/net/netfilter/xt_TPROXY.c:415: undefined reference to `nf_defrag_ipv6_enable'net/built-in.o: In function `socket_mt_init':/home/wangcong/linux/net/netfilter/xt_socket.c:366: undefined reference to `nf_defrag_ipv6_enable'My .config is:
CONFIG_NET_IPGRE=mCONFIG_IPV6=mCONFIG_INET6_AH=mCONFIG_INET6_ESP=mCONFIG_INET6_IPCOMP=mCONFIG_IPV6_MIP6=mCONFIG_INET6_XFRM_TUNNEL=mCONFIG_INET6_TUNNEL=mCONFIG_INET6_XFRM_MODE_TRANSPORT=mCONFIG_INET6_XFRM_MODE_TUNNEL=mCONFIG_INET6_XFRM_MODE_BEET=mCONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=mCONFIG_IPV6_SIT=mCONFIG_IPV6_TUNNEL=mCONFIG_IPV6_GRE=mCONFIG_NF_CONNTRACK_H323=mCONFIG_NETFILTER_XT_TARGET_TEE=mCONFIG_NETFILTER_XT_TARGET_TCPMSS=mCONFIG_NETFILTER_XT_MATCH_HASHLIMIT=mCONFIG_NETFILTER_XT_MATCH_PHYSDEV=mCONFIG_NF_NAT_H323=mCONFIG_NF_DEFRAG_IPV6=mCONFIG_NF_CONNTRACK_IPV6=mCONFIG_IP6_NF_IPTABLES=mCONFIG_IP6_NF_MATCH_AH=mCONFIG_IP6_NF_MATCH_EUI64=mCONFIG_IP6_NF_MATCH_FRAG=mCONFIG_IP6_NF_MATCH_OPTS=mCONFIG_IP6_NF_MATCH_HL=mCONFIG_IP6_NF_MATCH_IPV6HEADER=mCONFIG_IP6_NF_MATCH_MH=mCONFIG_IP6_NF_MATCH_RT=mCONFIG_IP6_NF_TARGET_HL=mCONFIG_IP6_NF_FILTER=mCONFIG_IP6_NF_TARGET_REJECT=mCONFIG_IP6_NF_MANGLE=mCONFIG_IP6_NF_RAW=mCONFIG_IP6_NF_SECURITY=mCONFIG_NF_NAT_IPV6=mCONFIG_IP6_NF_TARGET_MASQUERADE=mCONFIG_BRIDGE_NF_EBTABLES=mCONFIG_BRIDGE_EBT_BROUTE=mCONFIG_BRIDGE_EBT_T_FILTER=mCONFIG_BRIDGE_EBT_T_NAT=mCONFIG_BRIDGE_EBT_802_3=mCONFIG_BRIDGE_EBT_AMONG=mCONFIG_BRIDGE_EBT_ARP=mCONFIG_BRIDGE_EBT_IP=mCONFIG_BRIDGE_EBT_IP6=mCONFIG_BRIDGE_EBT_LIMIT=mCONFIG_BRIDGE_EBT_MARK=mCONFIG_BRIDGE_EBT_PKTTYPE=mCONFIG_BRIDGE_EBT_STP=mCONFIG_BRIDGE_EBT_VLAN=mCONFIG_BRIDGE_EBT_ARPREPLY=mCONFIG_BRIDGE_EBT_DNAT=mCONFIG_BRIDGE_EBT_MARK_T=mCONFIG_BRIDGE_EBT_REDIRECT=mCONFIG_BRIDGE_EBT_SNAT=mCONFIG_BRIDGE_EBT_LOG=mCONFIG_BRIDGE_EBT_ULOG=mCONFIG_BRIDGE_EBT_NFLOG=mCONFIG_IP_SCTP=mCONFIG_BRIDGE=mCONFIG_BONDING=m
Quoted 4 lines
all the rest are either =y or =n.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Pablo Neira Ayuso
maintainerQuoted 6 lines · Cong Wang
Hi, all
I got the following compile errors when I compile IPv6 as a module and most of the rest are built into core kernel. David Miller insists we should fix this kind of error and not by adding
Kconfigtricks.
Quoted 11 lines
net/built-in.o: In function `nf_tproxy_get_sock_v6':/home/wangcong/linux/include/net/netfilter/nf_tproxy_core.h:177:
undefined reference to `udp6_lib_lookup'/home/wangcong/linux/include/net/netfilter/nf_tproxy_core.h:177:
undefined reference to `udp6_lib_lookup'net/built-in.o: In function `tproxy_tg_init':/home/wangcong/linux/net/netfilter/xt_TPROXY.c:415: undefined reference to `nf_defrag_ipv6_enable'net/built-in.o: In function `socket_mt_init':/home/wangcong/linux/net/netfilter/xt_socket.c:366: undefined reference to `nf_defrag_ipv6_enable'
Looking at your incomplete .config, I don't see how you set xt_TPROXY and xt_socket but I bet they are =y.
For the udp6_lib_lookup dependency, you can use the ipv6 hooks added here:
commit 2a7851bffb008ff4882eee673da74718997b4265
Author: Florian Westphal <[email protected]> Date: Fri May 17 03:56:10 2013 +0000
netfilter: add nf_ipv6_ops hook to fix xt_addrtype with IPv6
Already in the nf tree, to resolve it. It would be fairly easy to make a patch for it.
For the nf_defrag_ipv6_enable, as I already mentioned, that's an artificial function to enforce the dependency between those two modules. We can add runtime checks in socket and TPROXY to skip further processing is nf_defrag_ipv6 is not loaded. But that's a problem because users will assume that their socket/TPROXY rule got loaded but it will not actually work since defrag is not loaded. I think that really needs some Kconfig tricks for that specific case.
Regards.
Quoted 25 lines · Pablo Neira Ayuso
Quoted 6 lines · Cong Wang
Hi, all
I got the following compile errors when I compile IPv6 as a module and most of the rest are built into core kernel. David Miller insists we should fix this kind of error and not by adding
Kconfigtricks.Quoted 11 lines
net/built-in.o: In function `nf_tproxy_get_sock_v6':/home/wangcong/linux/include/net/netfilter/nf_tproxy_core.h:177:
undefined reference to `udp6_lib_lookup'/home/wangcong/linux/include/net/netfilter/nf_tproxy_core.h:177:
undefined reference to `udp6_lib_lookup'net/built-in.o: In function `tproxy_tg_init':/home/wangcong/linux/net/netfilter/xt_TPROXY.c:415: undefined reference to `nf_defrag_ipv6_enable'net/built-in.o: In function `socket_mt_init':/home/wangcong/linux/net/netfilter/xt_socket.c:366: undefined reference to `nf_defrag_ipv6_enable'Looking at your incomplete .config, I don't see how you set
xt_TPROXYandxt_socketbut I bet they are =y.For the
udp6_lib_lookupdependency, you can use the ipv6 hooks added here:
Quoted 8 lines
commit
2a7851bffb008ff4882eee673da74718997b4265Author: Florian Westphal <[email protected]> Date: Fri May 17 03:56:10 2013 +0000netfilter: add
nf_ipv6_opshook to fixxt_addrtypewith IPv6Already in the nf tree, to resolve it. It would be fairly easy to make a patch for it.
Next time please Cc me, the reporter, when you submit a fix, otherwise I don't know if it is fixed, since I don't subscribe nf mailing list.
Quoted 9 lines
For the
nf_defrag_ipv6_enable, as I already mentioned, that's an artificial function to enforce the dependency between those two modules. We can add runtime checks in socket and TPROXY to skip further processing isnf_defrag_ipv6is not loaded. But that's a problem because users will assume that their socket/TPROXY rule got loaded but it will not actually work since defrag is not loaded. I think that really needs someKconfigtricks for that specific case.
Yeah, please send a fix? I can test it (together with my vxlan patches) if you need. I have no cycles to work on it even if it is simple. :)
Thanks!