aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pppox.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2009-01-21 18:54:54 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-21 18:54:54 -0500
commita6bcf1c1d38e0672db35e0d9f2504ac04ddf3ed5 (patch)
treeb6a27576096c40a89502f22bf420a408c54b2d63 /drivers/net/pppox.c
parent6aba915881918a429d656e874f7fec2efd37ad96 (diff)
net: pppoe - introduce net-namespace functionality
- each net-namespace for pppoe module is having own hash table and appropriate locks wich are allocated at time of namespace intialization. It requires about 140 bytes of memory for every new namespace but such approach allow us to escape from hash chains growing and additional lock contends (especially in SMP environment). - pppox code allows to create per-namespace sockets for PX_PROTO_OE protocol only (since at this moment support for pppol2tp net-namespace is not implemented yet). Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pppox.c')
-rw-r--r--drivers/net/pppox.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/pppox.c b/drivers/net/pppox.c
index 03aecc97fb45..ee9d3cf81beb 100644
--- a/drivers/net/pppox.c
+++ b/drivers/net/pppox.c
@@ -108,12 +108,13 @@ static int pppox_create(struct net *net, struct socket *sock, int protocol)
108{ 108{
109 int rc = -EPROTOTYPE; 109 int rc = -EPROTOTYPE;
110 110
111 if (net != &init_net)
112 return -EAFNOSUPPORT;
113
114 if (protocol < 0 || protocol > PX_MAX_PROTO) 111 if (protocol < 0 || protocol > PX_MAX_PROTO)
115 goto out; 112 goto out;
116 113
114 /* we support net-namespaces for PPPoE only (yet) */
115 if (protocol != PX_PROTO_OE && net != &init_net)
116 return -EAFNOSUPPORT;
117
117 rc = -EPROTONOSUPPORT; 118 rc = -EPROTONOSUPPORT;
118 if (!pppox_protos[protocol]) 119 if (!pppox_protos[protocol])
119 request_module("pppox-proto-%d", protocol); 120 request_module("pppox-proto-%d", protocol);