Skip to content

Commit

Permalink
udp: Remove redundant __udp_sysctl_init() call from udp_init().
Browse files Browse the repository at this point in the history
__udp_sysctl_init() is called for init_net via udp_sysctl_ops.

While at it, we can rename __udp_sysctl_init() to udp_sysctl_init().

Fixes: 1e80295 ("udp: Move the udp sysctl to namespace.")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kuniyuki Iwashima authored and David S. Miller committed Aug 1, 2022
1 parent b7d8912 commit 02a7cb2
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3264,19 +3264,15 @@ u32 udp_flow_hashrnd(void)
}
EXPORT_SYMBOL(udp_flow_hashrnd);

static void __udp_sysctl_init(struct net *net)
static int __net_init udp_sysctl_init(struct net *net)
{
net->ipv4.sysctl_udp_rmem_min = PAGE_SIZE;
net->ipv4.sysctl_udp_wmem_min = PAGE_SIZE;

#ifdef CONFIG_NET_L3_MASTER_DEV
net->ipv4.sysctl_udp_l3mdev_accept = 0;
#endif
}

static int __net_init udp_sysctl_init(struct net *net)
{
__udp_sysctl_init(net);
return 0;
}

Expand Down Expand Up @@ -3352,8 +3348,6 @@ void __init udp_init(void)
sysctl_udp_mem[1] = limit;
sysctl_udp_mem[2] = sysctl_udp_mem[0] * 2;

__udp_sysctl_init(&init_net);

/* 16 spinlocks per cpu */
udp_busylocks_log = ilog2(nr_cpu_ids) + 4;
udp_busylocks = kmalloc(sizeof(spinlock_t) << udp_busylocks_log,
Expand Down

0 comments on commit 02a7cb2

Please sign in to comment.