Patchwork [net-next,1/3] net: ipv6: minor: use in6addr_any in token init

login
register
mail settings
Submitter Daniel Borkmann
Date April 9, 2013, 1:47 p.m.
Message ID <1365515236-7154-2-git-send-email-dborkman@redhat.com>
Download mbox | patch
Permalink /patch/235085/
State Accepted
Delegated to: David Miller
Headers show

Comments

Daniel Borkmann - April 9, 2013, 1:47 p.m.
Since we check for !ipv6_addr_any(&in6_dev->token) in
addrconf_prefix_rcv(), make the token initialization on
device setup more intuitive by using in6addr_any as an
initializer.

Suggested-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
---
 net/ipv6/addrconf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Hannes Frederic Sowa - April 9, 2013, 8:37 p.m.
On Tue, Apr 09, 2013 at 03:47:14PM +0200, Daniel Borkmann wrote:
> Since we check for !ipv6_addr_any(&in6_dev->token) in
> addrconf_prefix_rcv(), make the token initialization on
> device setup more intuitive by using in6addr_any as an
> initializer.
> 
> Suggested-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>

Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 65d8139..645bf31 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -422,7 +422,7 @@  static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
 		ipv6_regen_rndid((unsigned long) ndev);
 	}
 #endif
-	memset(ndev->token.s6_addr, 0, sizeof(ndev->token.s6_addr));
+	ndev->token = in6addr_any;
 
 	if (netif_running(dev) && addrconf_qdisc_ok(dev))
 		ndev->if_flags |= IF_READY;