aboutsummaryrefslogtreecommitdiffstats
path: root/net/phonet/af_phonet.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/phonet/af_phonet.c')
-rw-r--r--net/phonet/af_phonet.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index 9d211f12582b..13cb323f8c38 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -67,9 +67,6 @@ static int pn_socket_create(struct net *net, struct socket *sock, int protocol)
67 struct phonet_protocol *pnp; 67 struct phonet_protocol *pnp;
68 int err; 68 int err;
69 69
70 if (net != &init_net)
71 return -EAFNOSUPPORT;
72
73 if (!capable(CAP_SYS_ADMIN)) 70 if (!capable(CAP_SYS_ADMIN))
74 return -EPERM; 71 return -EPERM;
75 72
@@ -352,9 +349,6 @@ static int phonet_rcv(struct sk_buff *skb, struct net_device *dev,
352 struct sockaddr_pn sa; 349 struct sockaddr_pn sa;
353 u16 len; 350 u16 len;
354 351
355 if (dev_net(dev) != &init_net)
356 goto out;
357
358 /* check we have at least a full Phonet header */ 352 /* check we have at least a full Phonet header */
359 if (!pskb_pull(skb, sizeof(struct phonethdr))) 353 if (!pskb_pull(skb, sizeof(struct phonethdr)))
360 goto out; 354 goto out;
@@ -373,7 +367,7 @@ static int phonet_rcv(struct sk_buff *skb, struct net_device *dev,
373 if (pn_sockaddr_get_addr(&sa) == 0) 367 if (pn_sockaddr_get_addr(&sa) == 0)
374 goto out; /* currently, we cannot be device 0 */ 368 goto out; /* currently, we cannot be device 0 */
375 369
376 sk = pn_find_sock_by_sa(&sa); 370 sk = pn_find_sock_by_sa(dev_net(dev), &sa);
377 if (sk == NULL) { 371 if (sk == NULL) {
378 if (can_respond(skb)) { 372 if (can_respond(skb)) {
379 send_obj_unreachable(skb); 373 send_obj_unreachable(skb);