aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/af_inet6.c
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2011-11-07 09:57:21 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-08 15:13:03 -0500
commitf74024d9f05caa570dcf7582b498bbf011943491 (patch)
tree1fa2bbbcbc337f6d1db23b09acd2ee8b48e37389 /net/ipv6/af_inet6.c
parent68aad78c5023b8aa82da99b47f9d8cf40e8ca453 (diff)
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/ipv6/af_inet6.c')
-rw-r--r--net/ipv6/af_inet6.c2
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)
347 */ 347 */
348 v4addr = LOOPBACK4_IPV6; 348 v4addr = LOOPBACK4_IPV6;
349 if (!(addr_type & IPV6_ADDR_MULTICAST)) { 349 if (!(addr_type & IPV6_ADDR_MULTICAST)) {
350 if (!inet->transparent && 350 if (!(inet->freebind || inet->transparent) &&
351 !ipv6_chk_addr(net, &addr->sin6_addr, 351 !ipv6_chk_addr(net, &addr->sin6_addr,
352 dev, 0)) { 352 dev, 0)) {
353 err = -EADDRNOTAVAIL; 353 err = -EADDRNOTAVAIL;