Skip to content

Commit 914eebf

Browse files
chamakenummakynes
authored andcommitted
netfilter: nfnetlink_log: autoload nf_conntrack_netlink module NFQA_CFG_F_CONNTRACK config flag
This patch enables to load nf_conntrack_netlink module if NFULNL_CFG_F_CONNTRACK config flag is specified. Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent c932245 commit 914eebf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

net/netfilter/nfnetlink_log.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,16 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
927927
}
928928

929929
if (flags & NFULNL_CFG_F_CONNTRACK &&
930-
rcu_access_pointer(nfnl_ct_hook) == NULL) {
930+
!rcu_access_pointer(nfnl_ct_hook)) {
931+
#ifdef CONFIG_MODULES
932+
nfnl_unlock(NFNL_SUBSYS_ULOG);
933+
request_module("ip_conntrack_netlink");
934+
nfnl_lock(NFNL_SUBSYS_ULOG);
935+
if (rcu_access_pointer(nfnl_ct_hook)) {
936+
ret = -EAGAIN;
937+
goto out;
938+
}
939+
#endif
931940
ret = -EOPNOTSUPP;
932941
goto out;
933942
}

0 commit comments

Comments
 (0)