From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: [Patch net-next] ipv6: exit early in addrconf_notify() if IPv6 is disabled Date: Thu, 11 Sep 2014 15:07:16 -0700 Message-ID: <1410473236-3346-1-git-send-email-xiyou.wangcong@gmail.com> Cc: Hideaki YOSHIFUJI , "David S. Miller" , Cong Wang To: netdev@vger.kernel.org Return-path: Received: from mail-pa0-f46.google.com ([209.85.220.46]:47040 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752182AbaIKWHi (ORCPT ); Thu, 11 Sep 2014 18:07:38 -0400 Received: by mail-pa0-f46.google.com with SMTP id kq14so7713899pab.33 for ; Thu, 11 Sep 2014 15:07:37 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: If IPv6 is explicitly disabled before the interface comes up, it makes no sense to continue when it comes up, even just print a message. (I am not sure about other cases though, so I prefer not to touch) Signed-off-by: Cong Wang --- diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index ad4598f..12a2efe 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -2844,6 +2844,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, if (dev->flags & IFF_SLAVE) break; + if (idev && idev->cnf.disable_ipv6) + break; + if (event == NETDEV_UP) { if (!addrconf_qdisc_ok(dev)) { /* device is not ready yet. */