netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, hannes@stressinduktion.org
Subject: [PATCH net-next 1/3] net: ipv6: minor: use in6addr_any in token init
Date: Tue,  9 Apr 2013 15:47:14 +0200	[thread overview]
Message-ID: <1365515236-7154-2-git-send-email-dborkman@redhat.com> (raw)
In-Reply-To: <1365515236-7154-1-git-send-email-dborkman@redhat.com>

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(-)

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;
-- 
1.7.1

  reply	other threads:[~2013-04-09 13:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 13:47 [PATCH net-next 0/3] follow-up improvements for ipv6 tokens Daniel Borkmann
2013-04-09 13:47 ` Daniel Borkmann [this message]
2013-04-09 20:37   ` [PATCH net-next 1/3] net: ipv6: minor: use in6addr_any in token init Hannes Frederic Sowa
2013-04-09 13:47 ` [PATCH net-next 2/3] net: ipv6: also allow token to be set when device not ready Daniel Borkmann
2013-04-09 20:37   ` Hannes Frederic Sowa
2013-04-09 13:47 ` [PATCH net-next 3/3] net: ipv6: only invalidate previously tokenized addresses Daniel Borkmann
2013-04-09 20:38   ` Hannes Frederic Sowa
2013-04-09 17:12 ` [PATCH net-next 0/3] follow-up improvements for ipv6 tokens David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1365515236-7154-2-git-send-email-dborkman@redhat.com \
    --to=dborkman@redhat.com \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).