netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
To: netdev@vger.kernel.org
Cc: usagi-core@linux-ipv6.org
Subject: [PATCH] Ensure IF_READY is unset when link is not ready
Date: Mon, 5 Mar 2007 17:59:24 +0900	[thread overview]
Message-ID: <20070305175924.2f46446c.mitch@linux.vnet.ibm.com> (raw)

Hi there,

On linux-2.6.21-rc2 or later, IPv6 link-local address is not assigned to
some kind of interfaces during system start-up. (I found this issue
occures with e100, e1000 and tg3.)

This issue comes from the change that inet6_dev is allocated when
NETDEV_REGISTER event occurs. The allocation code is at ipv6_add_dev()
in net/ipv6/addrinfo.c. At the code, IF_READY bit would be set when the
link is ready. The link readyness is verified by netif_caeeir_ok().
However as the drivers don't call netif_carrier_off() prior to calling
register_netdev(), netif_caeeir_ok() returns true in spite of the
actual link state.

Here's a work around patch. This make IF_READY unset when NETDEV_UP
event occurs and the link is not ready. This patch may not be an
fundamental fix. But I don't have any other idea now.

Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
---
 net/ipv6/addrconf.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index e16f1bb..1593cd1 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2196,6 +2196,7 @@ static int addrconf_notify(struct notifi
 					"ADDRCONF(NETDEV_UP): %s: "
 					"link is not ready\n",
 					dev->name);
+				idev->if_flags &= ~IF_READY;
 				break;
 			}
 
-- 
1.4.3.4


             reply	other threads:[~2007-03-05  8:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-05  8:59 Mitsuru Chinen [this message]
2007-03-07 23:47 ` [PATCH] Ensure IF_READY is unset when link is not ready Herbert Xu
2007-03-07 23:54   ` David Miller
2007-03-08  2:01     ` Mitsuru Chinen

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=20070305175924.2f46446c.mitch@linux.vnet.ibm.com \
    --to=mitch@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=usagi-core@linux-ipv6.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).