summaryrefslogtreecommitdiff
path: root/net/ipv6/datagram.c
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2011-11-07 14:57:22 +0000
committerDavid S. Miller <davem@davemloft.net>2011-11-08 15:13:03 -0500
commit2563fa595447bba6a73e6c58c4bbf11ac0f28931 (patch)
tree973f75cb61b84c41e7047bfa759197b3e1e39f22 /net/ipv6/datagram.c
parentf74024d9f05caa570dcf7582b498bbf011943491 (diff)
downloadlwn-2563fa595447bba6a73e6c58c4bbf11ac0f28931.tar.gz
lwn-2563fa595447bba6a73e6c58c4bbf11ac0f28931.zip
net: make ipv6 PKTINFO honour freebind
This just makes it possible to spoof source IPv6 address on a socket without having to create and bind a new socket for every source IP we wish to spoof. Signed-off-by: Maciej Żenczykowski <maze@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/datagram.c')
-rw-r--r--net/ipv6/datagram.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index e2480691c220..83037af4fa7b 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -654,7 +654,7 @@ int datagram_send_ctl(struct net *net, struct sock *sk,
if (addr_type != IPV6_ADDR_ANY) {
int strict = __ipv6_addr_src_scope(addr_type) <= IPV6_ADDR_SCOPE_LINKLOCAL;
- if (!inet_sk(sk)->transparent &&
+ if (!(inet_sk(sk)->freebind || inet_sk(sk)->transparent) &&
!ipv6_chk_addr(net, &src_info->ipi6_addr,
strict ? dev : NULL, 0))
err = -EINVAL;