Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f99e8f71 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by David S. Miller
Browse files

net: Convert nf_conntrack_proto to use register_net_sysctl



There isn't much advantage here except that strings paths are a bit
easier to read, and converting everything to them allows me to kill off
ctl_path.

Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Acked-by: default avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8607ddb8
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -65,7 +65,7 @@ struct nf_conntrack_l3proto {


#ifdef CONFIG_SYSCTL
#ifdef CONFIG_SYSCTL
	struct ctl_table_header	*ctl_table_header;
	struct ctl_table_header	*ctl_table_header;
	struct ctl_path		*ctl_table_path;
	const char		*ctl_table_path;
	struct ctl_table	*ctl_table;
	struct ctl_table	*ctl_table;
#endif /* CONFIG_SYSCTL */
#endif /* CONFIG_SYSCTL */


+1 −1
Original line number Original line Diff line number Diff line
@@ -365,7 +365,7 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4 __read_mostly = {
	.nla_policy	 = ipv4_nla_policy,
	.nla_policy	 = ipv4_nla_policy,
#endif
#endif
#if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT)
#if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT)
	.ctl_table_path  = nf_net_ipv4_netfilter_sysctl_path,
	.ctl_table_path  = "net/ipv4/netfilter",
	.ctl_table	 = ip_ct_sysctl_table,
	.ctl_table	 = ip_ct_sysctl_table,
#endif
#endif
	.me		 = THIS_MODULE,
	.me		 = THIS_MODULE,
+4 −4
Original line number Original line Diff line number Diff line
@@ -36,11 +36,11 @@ static DEFINE_MUTEX(nf_ct_proto_mutex);


#ifdef CONFIG_SYSCTL
#ifdef CONFIG_SYSCTL
static int
static int
nf_ct_register_sysctl(struct ctl_table_header **header, struct ctl_path *path,
nf_ct_register_sysctl(struct ctl_table_header **header, const char *path,
		      struct ctl_table *table, unsigned int *users)
		      struct ctl_table *table, unsigned int *users)
{
{
	if (*header == NULL) {
	if (*header == NULL) {
		*header = register_net_sysctl_table(&init_net, path, table);
		*header = register_net_sysctl(&init_net, path, table);
		if (*header == NULL)
		if (*header == NULL)
			return -ENOMEM;
			return -ENOMEM;
	}
	}
@@ -250,7 +250,7 @@ static int nf_ct_l4proto_register_sysctl(struct nf_conntrack_l4proto *l4proto)
#ifdef CONFIG_SYSCTL
#ifdef CONFIG_SYSCTL
	if (l4proto->ctl_table != NULL) {
	if (l4proto->ctl_table != NULL) {
		err = nf_ct_register_sysctl(l4proto->ctl_table_header,
		err = nf_ct_register_sysctl(l4proto->ctl_table_header,
					    nf_net_netfilter_sysctl_path,
					    "net/netfilter",
					    l4proto->ctl_table,
					    l4proto->ctl_table,
					    l4proto->ctl_table_users);
					    l4proto->ctl_table_users);
		if (err < 0)
		if (err < 0)
@@ -259,7 +259,7 @@ static int nf_ct_l4proto_register_sysctl(struct nf_conntrack_l4proto *l4proto)
#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
	if (l4proto->ctl_compat_table != NULL) {
	if (l4proto->ctl_compat_table != NULL) {
		err = nf_ct_register_sysctl(&l4proto->ctl_compat_table_header,
		err = nf_ct_register_sysctl(&l4proto->ctl_compat_table_header,
					    nf_net_ipv4_netfilter_sysctl_path,
					    "net/ipv4/netfilter",
					    l4proto->ctl_compat_table, NULL);
					    l4proto->ctl_compat_table, NULL);
		if (err == 0)
		if (err == 0)
			goto out;
			goto out;