netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mahesh Kelkar <maheshkelkar@gmail.com>
To: Brian Haley <brian.haley@hp.com>
Cc: netdev@vger.kernel.org, David Miller <davem@davemloft.net>
Subject: Last Ipv6 address removal causes "addrconf_sysctl_unregister", which inihibits from changing disable_ipv6 setting
Date: Mon, 26 Jul 2010 10:03:13 -0400	[thread overview]
Message-ID: <AANLkTimnBssEeO_faqcAAzHCy8KxQo9FVcn7vu5fru4j@mail.gmail.com> (raw)

Odd behavior associated with the patch:
**Last address removal causes "addrconf_sysctl_unregister", which
inihibits from changing disable_ipv6 setting
(connected issue: With disable_ipv6 set to 1 on an interface, ff00:/8
and fe80::/64 are still added on device UP)

Current sysctl config:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

Steps:
- Remove last IPv6 address assigned to the "eth0" interface
- inet6_addr_del => addrconf_ifdown(idev->dev, 1) => does the device
sysctl unregister
******Not sure why the addrconf_sysctl_unregister is necessary on last
address removal*******
- Now, "sysctl -a" does not show "net.ipv6.conf.eth0.disable_ipv6"

Problem:
- If you WANT to assign IPv6 address to eth0,
-> Do it once, which fails due to "disable_ipv6" check in
addrconf_add_dev OR ipv6_add_addr
-> But, this process does "addrconf_sysctl_register" (addrconf_add_dev
=> ipv6_find_idev => ipv6_add_dev)
-> set net.ipv6.conf.eth0.disable_ipv6=0 and then successfully assign
ipv6-address to the eth0
(Another alternative is to change all or default to 1; but I wanted to
disable ipv6 by default)

===============
Probable Solution:
===============
@@ -1948,7 +1959,7 @@ static int inet6_addr_del(int ifindex, s
 			   disable IPv6 on this interface.
 			 */
 			if (idev->addr_list == NULL)
-				addrconf_ifdown(idev->dev, 1);
+				addrconf_ifdown(idev->dev, 0);
 			return 0;
 		}
 	}
I have tested the above solution and it seems to work fine - so far.

             reply	other threads:[~2010-07-26 14:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26 14:03 Mahesh Kelkar [this message]
2010-07-26 20:17 ` Last Ipv6 address removal causes "addrconf_sysctl_unregister", which inihibits from changing disable_ipv6 setting Brian Haley
2010-07-26 20:37   ` Mahesh Kelkar

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=AANLkTimnBssEeO_faqcAAzHCy8KxQo9FVcn7vu5fru4j@mail.gmail.com \
    --to=maheshkelkar@gmail.com \
    --cc=brian.haley@hp.com \
    --cc=davem@davemloft.net \
    --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).