diff options
author | 2011-11-07 14:57:21 +0000 | |
---|---|---|
committer | 2011-11-08 15:13:03 -0500 | |
commit | f74024d9f05caa570dcf7582b498bbf011943491 (patch) | |
tree | 1fa2bbbcbc337f6d1db23b09acd2ee8b48e37389 /net | |
parent | sweep the floors and convert some .get_drvinfo routines to strlcpy (diff) | |
download | linux-f74024d9f05caa570dcf7582b498bbf011943491.tar.gz linux-f74024d9f05caa570dcf7582b498bbf011943491.tar.bz2 linux-f74024d9f05caa570dcf7582b498bbf011943491.zip |
net: make ipv6 bind honour freebind
This makes native ipv6 bind follow the precedent set by:
- native ipv4 bind behaviour
- dual stack ipv4-mapped ipv6 bind behaviour.
This does allow an unpriviledged process to spoof its source IPv6
address, just like it currently can spoof its source IPv4 address
(for example when using UDP).
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/af_inet6.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index d27c797f9f05..1040424c788f 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -347,7 +347,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) */ v4addr = LOOPBACK4_IPV6; if (!(addr_type & IPV6_ADDR_MULTICAST)) { - if (!inet->transparent && + if (!(inet->freebind || inet->transparent) && !ipv6_chk_addr(net, &addr->sin6_addr, dev, 0)) { err = -EADDRNOTAVAIL; |