Skip to content

Commit 30f5815

Browse files
arndbummakynes
authored andcommitted
udp: provide udp{4,6}_lib_lookup for nf_socket_ipv{4,6}
Since commit ca065d0 ("udp: no longer use SLAB_DESTROY_BY_RCU") the udp6_lib_lookup and udp4_lib_lookup functions are only provided when it is actually possible to call them. However, moving the callers now caused a link error: net/built-in.o: In function `nf_sk_lookup_slow_v6': (.text+0x131a39): undefined reference to `udp6_lib_lookup' net/ipv4/netfilter/nf_socket_ipv4.o: In function `nf_sk_lookup_slow_v4': nf_socket_ipv4.c:(.text.nf_sk_lookup_slow_v4+0x114): undefined reference to `udp4_lib_lookup' This extends the #ifdef so we also provide the functions when CONFIG_NF_SOCKET_IPV4 or CONFIG_NF_SOCKET_IPV6, respectively are set. Fixes: 8db4c5b ("netfilter: move socket lookup infrastructure to nf_socket_ipv{4,6}.c") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 0e54d21 commit 30f5815

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

net/ipv4/udp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,8 @@ EXPORT_SYMBOL_GPL(udp4_lib_lookup_skb);
580580
* Does increment socket refcount.
581581
*/
582582
#if IS_ENABLED(CONFIG_NETFILTER_XT_MATCH_SOCKET) || \
583-
IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TPROXY)
583+
IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TPROXY) || \
584+
IS_ENABLED(CONFIG_NF_SOCKET_IPV4)
584585
struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
585586
__be32 daddr, __be16 dport, int dif)
586587
{

net/ipv6/udp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ EXPORT_SYMBOL_GPL(udp6_lib_lookup_skb);
302302
* Does increment socket refcount.
303303
*/
304304
#if IS_ENABLED(CONFIG_NETFILTER_XT_MATCH_SOCKET) || \
305-
IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TPROXY)
305+
IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TPROXY) || \
306+
IS_ENABLED(CONFIG_NF_SOCKET_IPV6)
306307
struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *saddr, __be16 sport,
307308
const struct in6_addr *daddr, __be16 dport, int dif)
308309
{

0 commit comments

Comments
 (0)