#include <linux/workqueue.h>
#include <linux/list.h>
+#include <net/netns/core.h>
#include <net/netns/unix.h>
#include <net/netns/packet.h>
#include <net/netns/ipv4.h>
struct sock *rtnl; /* rtnetlink socket */
- /* core sysctls */
- struct ctl_table_header *sysctl_core_hdr;
- int sysctl_somaxconn;
-
+ struct netns_core core;
struct netns_packet packet;
struct netns_unix unx;
struct netns_ipv4 ipv4;
--- /dev/null
+#ifndef __NETNS_CORE_H__
+#define __NETNS_CORE_H__
+
+struct ctl_table_header;
+
+struct netns_core {
+ /* core sysctls */
+ struct ctl_table_header *sysctl_hdr;
+
+ int sysctl_somaxconn;
+};
+
+#endif
{
.ctl_name = NET_CORE_SOMAXCONN,
.procname = "somaxconn",
- .data = &init_net.sysctl_somaxconn,
+ .data = &init_net.core.sysctl_somaxconn,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
{
struct ctl_table *tbl, *tmp;
- net->sysctl_somaxconn = SOMAXCONN;
+ net->core.sysctl_somaxconn = SOMAXCONN;
tbl = net_core_table;
if (net != &init_net) {
}
}
- net->sysctl_core_hdr = register_net_sysctl_table(net,
+ net->core.sysctl_hdr = register_net_sysctl_table(net,
net_core_path, tbl);
- if (net->sysctl_core_hdr == NULL)
+ if (net->core.sysctl_hdr == NULL)
goto err_reg;
return 0;
{
struct ctl_table *tbl;
- tbl = net->sysctl_core_hdr->ctl_table_arg;
- unregister_net_sysctl_table(net->sysctl_core_hdr);
+ tbl = net->core.sysctl_hdr->ctl_table_arg;
+ unregister_net_sysctl_table(net->core.sysctl_hdr);
BUG_ON(tbl == net_core_table);
kfree(tbl);
}
sock = sockfd_lookup_light(fd, &err, &fput_needed);
if (sock) {
- somaxconn = sock_net(sock->sk)->sysctl_somaxconn;
+ somaxconn = sock_net(sock->sk)->core.sysctl_somaxconn;
if ((unsigned)backlog > somaxconn)
backlog = somaxconn;