Skip to content

Commit c753032

Browse files
hs256ummakynes
authored andcommitted
netfilter: cttimeout: Make NF_CT_NETLINK_TIMEOUT depend on NF_CONNTRACK_TIMEOUT
With this, remove ifdef for CONFIG_NF_CONNTRACK_TIMEOUT in nfnetlink_cttimeout. This is also required for moving ctnl_untimeout from nfnetlink_cttimeout to nf_conntrack_timeout. Signed-off-by: Harsha Sharma <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 1974d24 commit c753032

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

net/netfilter/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ config NF_CT_NETLINK_TIMEOUT
365365
tristate 'Connection tracking timeout tuning via Netlink'
366366
select NETFILTER_NETLINK
367367
depends on NETFILTER_ADVANCED
368+
depends on NF_CONNTRACK_TIMEOUT
368369
help
369370
This option enables support for connection tracking timeout
370371
fine-grain tuning. This allows you to attach specific timeout

net/netfilter/nfnetlink_cttimeout.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,6 @@ static int cttimeout_default_get(struct net *net, struct sock *ctnl,
503503
return err;
504504
}
505505

506-
#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
507506
static struct ctnl_timeout *
508507
ctnl_timeout_find_get(struct net *net, const char *name)
509508
{
@@ -534,7 +533,6 @@ static void ctnl_timeout_put(struct ctnl_timeout *timeout)
534533

535534
module_put(THIS_MODULE);
536535
}
537-
#endif /* CONFIG_NF_CONNTRACK_TIMEOUT */
538536

539537
static const struct nfnl_callback cttimeout_cb[IPCTNL_MSG_TIMEOUT_MAX] = {
540538
[IPCTNL_MSG_TIMEOUT_NEW] = { .call = cttimeout_new_timeout,
@@ -605,10 +603,8 @@ static int __init cttimeout_init(void)
605603
"nfnetlink.\n");
606604
goto err_out;
607605
}
608-
#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
609606
RCU_INIT_POINTER(nf_ct_timeout_find_get_hook, ctnl_timeout_find_get);
610607
RCU_INIT_POINTER(nf_ct_timeout_put_hook, ctnl_timeout_put);
611-
#endif /* CONFIG_NF_CONNTRACK_TIMEOUT */
612608
return 0;
613609

614610
err_out:
@@ -621,11 +617,9 @@ static void __exit cttimeout_exit(void)
621617
nfnetlink_subsys_unregister(&cttimeout_subsys);
622618

623619
unregister_pernet_subsys(&cttimeout_ops);
624-
#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
625620
RCU_INIT_POINTER(nf_ct_timeout_find_get_hook, NULL);
626621
RCU_INIT_POINTER(nf_ct_timeout_put_hook, NULL);
627622
synchronize_rcu();
628-
#endif /* CONFIG_NF_CONNTRACK_TIMEOUT */
629623
}
630624

631625
module_init(cttimeout_init);

0 commit comments

Comments
 (0)