netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] IPv6: enable bind() to assign an anycast address
@ 2014-02-12 13:38 Francois-Xavier Le Bail
  2014-02-13  0:16 ` Hannes Frederic Sowa
  0 siblings, 1 reply; 11+ messages in thread
From: Francois-Xavier Le Bail @ 2014-02-12 13:38 UTC (permalink / raw)
  To: NETDEV, David Miller, Hannes Frederic Sowa

- Use ipv6_chk_acast_addr_src() in inet6_bind().

Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com>
---
v2: ipv6_chk_acast_addr_src() was previously added.

 net/ipv6/af_inet6.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index c921d5d..68b81e9 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -347,7 +347,9 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 			if (!(addr_type & IPV6_ADDR_MULTICAST))	{
 				if (!(inet->freebind || inet->transparent) &&
 				    !ipv6_chk_addr(net, &addr->sin6_addr,
-						   dev, 0)) {
+						   dev, 0) &&
+				    !ipv6_chk_acast_addr_src(net, dev,
+							     &addr->sin6_addr)) {
 					err = -EADDRNOTAVAIL;
 					goto out_unlock;
 				}

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH net-next v2] IPv6: enable bind() to assign an anycast address
@ 2014-01-13 16:59 Francois-Xavier Le Bail
  0 siblings, 0 replies; 11+ messages in thread
From: Francois-Xavier Le Bail @ 2014-01-13 16:59 UTC (permalink / raw)
  To: netdev
  Cc: Hannes Frederic Sowa, David S. Miller, Alexey Kuznetsov,
	James Morris, Hideaki Yoshifuji, Patrick McHardy,
	Francois-Xavier Le Bail

- Use ipv6_chk_acast_addr_src() in inet6_bind().

Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com>
---
Tested with SOCK_DGRAM and SOCK_STREAM sockets.
Tested with link-local and global anycast addresses.

 net/ipv6/af_inet6.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index c921d5d..68b81e9 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -347,7 +347,9 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 			if (!(addr_type & IPV6_ADDR_MULTICAST))	{
 				if (!(inet->freebind || inet->transparent) &&
 				    !ipv6_chk_addr(net, &addr->sin6_addr,
-						   dev, 0)) {
+						   dev, 0) &&
+				    !ipv6_chk_acast_addr_src(net, dev,
+							     &addr->sin6_addr)) {
 					err = -EADDRNOTAVAIL;
 					goto out_unlock;
 				}

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-02-17 19:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-12 13:38 [PATCH net-next v2] IPv6: enable bind() to assign an anycast address Francois-Xavier Le Bail
2014-02-13  0:16 ` Hannes Frederic Sowa
2014-02-17  5:15   ` David Miller
2014-02-17  9:32     ` Christoph Paasch
2014-02-17 10:02       ` Alexey Kuznetsov
2014-02-17 19:19         ` David Miller
2014-02-17 19:25           ` Hannes Frederic Sowa
2014-02-17 19:42           ` François-Xavier Le Bail
2014-02-17 19:48             ` David Miller
2014-02-17 19:52               ` François-Xavier Le Bail
  -- strict thread matches above, loose matches on Subject: below --
2014-01-13 16:59 Francois-Xavier Le Bail

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).