aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/af_inet6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/af_inet6.c')
-rw-r--r--net/ipv6/af_inet6.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 6b793bfc0e10..ab5c7ad482cd 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -49,7 +49,6 @@
49#include <net/udp.h> 49#include <net/udp.h>
50#include <net/udplite.h> 50#include <net/udplite.h>
51#include <net/tcp.h> 51#include <net/tcp.h>
52#include <net/ipip.h>
53#include <net/protocol.h> 52#include <net/protocol.h>
54#include <net/inet_common.h> 53#include <net/inet_common.h>
55#include <net/route.h> 54#include <net/route.h>
@@ -323,7 +322,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
323 struct net_device *dev = NULL; 322 struct net_device *dev = NULL;
324 323
325 rcu_read_lock(); 324 rcu_read_lock();
326 if (addr_type & IPV6_ADDR_LINKLOCAL) { 325 if (__ipv6_addr_needs_scope_id(addr_type)) {
327 if (addr_len >= sizeof(struct sockaddr_in6) && 326 if (addr_len >= sizeof(struct sockaddr_in6) &&
328 addr->sin6_scope_id) { 327 addr->sin6_scope_id) {
329 /* Override any existing binding, if another one 328 /* Override any existing binding, if another one
@@ -471,8 +470,8 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr,
471 470
472 sin->sin6_port = inet->inet_sport; 471 sin->sin6_port = inet->inet_sport;
473 } 472 }
474 if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL) 473 sin->sin6_scope_id = ipv6_iface_scope_id(&sin->sin6_addr,
475 sin->sin6_scope_id = sk->sk_bound_dev_if; 474 sk->sk_bound_dev_if);
476 *uaddr_len = sizeof(*sin); 475 *uaddr_len = sizeof(*sin);
477 return 0; 476 return 0;
478} 477}