Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171114
b: refs/heads/master
c: 16ba5e8
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 2, 2009
1 parent c3a90c8 commit a54b0c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f1a28eab20076542322fcab3efa016834bd732f2
refs/heads/master: 16ba5e8e7c01d2da87ff1d17e83545f164665b5c
17 changes: 9 additions & 8 deletions trunk/net/ipv6/af_inet6.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
if (addr_type != IPV6_ADDR_ANY) {
struct net_device *dev = NULL;

rcu_read_lock();
if (addr_type & IPV6_ADDR_LINKLOCAL) {
if (addr_len >= sizeof(struct sockaddr_in6) &&
addr->sin6_scope_id) {
Expand All @@ -326,12 +327,12 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
/* Binding to link-local address requires an interface */
if (!sk->sk_bound_dev_if) {
err = -EINVAL;
goto out;
goto out_unlock;
}
dev = dev_get_by_index(net, sk->sk_bound_dev_if);
dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if);
if (!dev) {
err = -ENODEV;
goto out;
goto out_unlock;
}
}

Expand All @@ -342,14 +343,11 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
if (!(addr_type & IPV6_ADDR_MULTICAST)) {
if (!ipv6_chk_addr(net, &addr->sin6_addr,
dev, 0)) {
if (dev)
dev_put(dev);
err = -EADDRNOTAVAIL;
goto out;
goto out_unlock;
}
}
if (dev)
dev_put(dev);
rcu_read_unlock();
}
}

Expand Down Expand Up @@ -381,6 +379,9 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
out:
release_sock(sk);
return err;
out_unlock:
rcu_read_unlock();
goto out;
}

EXPORT_SYMBOL(inet6_bind);
Expand Down

0 comments on commit a54b0c3

Please sign in to comment.