diff options
-rw-r--r-- | net/ipv4/raw.c | 2 | ||||
-rw-r--r-- | net/ipv6/raw.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 4e95372a78e7..206c869db921 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -625,7 +625,7 @@ static int raw_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
625 | 625 | ||
626 | if (sk->sk_state != TCP_CLOSE || addr_len < sizeof(struct sockaddr_in)) | 626 | if (sk->sk_state != TCP_CLOSE || addr_len < sizeof(struct sockaddr_in)) |
627 | goto out; | 627 | goto out; |
628 | chk_addr_ret = inet_addr_type(&init_net, addr->sin_addr.s_addr); | 628 | chk_addr_ret = inet_addr_type(sk->sk_net, addr->sin_addr.s_addr); |
629 | ret = -EADDRNOTAVAIL; | 629 | ret = -EADDRNOTAVAIL; |
630 | if (addr->sin_addr.s_addr && chk_addr_ret != RTN_LOCAL && | 630 | if (addr->sin_addr.s_addr && chk_addr_ret != RTN_LOCAL && |
631 | chk_addr_ret != RTN_MULTICAST && chk_addr_ret != RTN_BROADCAST) | 631 | chk_addr_ret != RTN_MULTICAST && chk_addr_ret != RTN_BROADCAST) |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 026fa910cb70..970529e4754a 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -291,7 +291,7 @@ static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
291 | if (!sk->sk_bound_dev_if) | 291 | if (!sk->sk_bound_dev_if) |
292 | goto out; | 292 | goto out; |
293 | 293 | ||
294 | dev = dev_get_by_index(&init_net, sk->sk_bound_dev_if); | 294 | dev = dev_get_by_index(sk->sk_net, sk->sk_bound_dev_if); |
295 | if (!dev) { | 295 | if (!dev) { |
296 | err = -ENODEV; | 296 | err = -ENODEV; |
297 | goto out; | 297 | goto out; |
@@ -304,7 +304,7 @@ static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
304 | v4addr = LOOPBACK4_IPV6; | 304 | v4addr = LOOPBACK4_IPV6; |
305 | if (!(addr_type & IPV6_ADDR_MULTICAST)) { | 305 | if (!(addr_type & IPV6_ADDR_MULTICAST)) { |
306 | err = -EADDRNOTAVAIL; | 306 | err = -EADDRNOTAVAIL; |
307 | if (!ipv6_chk_addr(&init_net, &addr->sin6_addr, | 307 | if (!ipv6_chk_addr(sk->sk_net, &addr->sin6_addr, |
308 | dev, 0)) { | 308 | dev, 0)) { |
309 | if (dev) | 309 | if (dev) |
310 | dev_put(dev); | 310 | dev_put(dev); |