Bug 188032 - [lo] IPv6 on lo never leaves 'tentative' state if configured with prefixlen 128
Summary: [lo] IPv6 on lo never leaves 'tentative' state if configured with prefixlen 128
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.0-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Hiroki Sato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-28 16:10 UTC by Baginski Darren
Modified: 2019-01-21 09:37 UTC (History)
3 users (show)

See Also:
bugmeister: mfc-stable10?
bugmeister: mfc-stable9?
bugmeister: mfc-stable8?


Attachments
A patch to automatically clear ifdisabled flag even in /128 case (2.18 KB, patch)
2014-10-30 02:43 UTC, Hiroki Sato
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Baginski Darren 2014-03-28 16:10:02 UTC
IPv6 on lo never leaves 'tentative' state if configured with prefixlen 128.

Steps to reproduce.

# ifconfig lo8 create
# ifconfig lo8 up
# ifconfig lo8 inet6 fc00::ff prefixlen 128


# ifconfig lo8
lo8: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 fc00::ff prefixlen 128 tentative 
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>


lo8 ipv6 stays 'tentative' stays forever and never become ping-able.

"Workaround" is to apply any other prefixlen, e.g. /127

Fix: 

"Workaround" is to apply any other prefixlen, e.g. /127
How-To-Repeat: 
# ifconfig lo8 create
# ifconfig lo8 up
# ifconfig lo8 inet6 fc00::ff prefixlen 128


# ifconfig lo8
lo8: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 fc00::ff prefixlen 128 tentative 
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

# ping fc00::ff
Comment 1 Andrey V. Elsukov 2014-03-31 09:11:14 UTC
Hello,

Actually the problem is in your configuration. As you may see, you have
IFDISABLED flag set. When you are configuring /127 prefix, the system
does install route on that prefix and automatically clears IFDISABLED
flag. When you are configuring /128 prefix, the system won't install
route and thus IFDISABLED flag still here. With IFDISABLED flag the
system won't do DAD and  tentative flag will never cleared.

-- 
WBR, Andrey V. Elsukov
Comment 2 Baginski Darren 2014-04-03 02:08:45 UTC
I'm not setting IFDISABLED flag as you see from output below.
Moreover the same set of commands doesn't dot put interface into IFDISABLED sate on FreeBSD 7.x, 8.x, 9.x
Again, if I set IPv4 /32 it works as well. 
Thus this /128 case is a clear regression.
Comment 3 Andrey V. Elsukov 2014-04-03 09:46:55 UTC
All interfaces have IFDISABLED flag if you have not configured IPv6 for
them.

-- 
WBR, Andrey V. Elsukov
Comment 4 Baginski Darren 2014-04-04 18:18:23 UTC
I do configure IPv6, output clearly says that, and more specifically I configure it with /128.
Let me show again again:

case A, getting 'tentative'
# ifconfig lo8 create
# ifconfig lo8 up
# ifconfig lo8 inet6 fc00::ff prefixlen 128               <- configuring IPv6 address with /128 prefix

case B, all good, NO 'tentative'
# ifconfig lo8 create
# ifconfig lo8 up
# ifconfig lo8 inet6 fc00::ff prefixlen 127              <- configuring IPv6 address with /127 prefix

On FreeBSD 7.x, 8.x, 9.x case A works, while on 10.x interface is stuck in `tentative` permanently.
Comment 5 Andrey V. Elsukov freebsd_committer freebsd_triage 2014-04-04 18:25:47 UTC
I described why this works as you see in the first message.
There are number of configuration variables related to IPv6
configuration. I.e. ipv6_enable, ipv6_activate_all_interfaces,
ifconfig_xxx_ipv6. These variables controls behavior of the system
when new interface will appears. You can read /etc/network.subr and you
will see that presence of IFDISABLED flag depends from these variables.

-- 
WBR, Andrey V. Elsukov
Comment 6 Baginski Darren 2014-04-10 17:35:09 UTC
Basically behavior is is like that

/128 mask:
ipv6_activate_all_interfaces="YES" && /128  -> OK
NO ipv6_activate_all_interfaces && /128  -> *tentative*

/127 mask:
ipv6_activate_all_interfaces="YES" && /127  -> OK
NO ipv6_activate_all_interfaces && /127  -> *OK*

I find that behavior is inconsistent, mask of /128 has no any magic meaning.
Comment 7 Mark Linimon freebsd_committer freebsd_triage 2014-04-16 02:26:32 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-net

assign.
Comment 8 js 2014-10-28 03:10:44 UTC
I was pulling my hair out all day trying to figure out why my jails weren't working with IPv6, and finally figured out they couldn't use their assigned IP addresses.  A few hours later I noticed the "tentative" in ifconfig and eventually stumbled on this PR.  IMO, the lack of "ipv6_activate_all_interfaces" should have no effect on the status of the interfaces when they're explicitly configured in jail settings.
Comment 9 Hiroki Sato freebsd_committer freebsd_triage 2014-10-30 02:37:37 UTC
Take.
Comment 10 Hiroki Sato freebsd_committer freebsd_triage 2014-10-30 02:43:20 UTC
Created attachment 148784 [details]
A patch to automatically clear ifdisabled flag even in /128 case

Please try this patch.
Comment 11 js 2014-11-01 01:39:09 UTC
Thanks for the patch!  It worked perfectly for me.  Please commit to 10-STABLE and CURRENT.
Comment 12 commit-hook freebsd_committer freebsd_triage 2014-11-02 21:59:11 UTC
A commit references this bug:

Author: hrs
Date: Sun Nov  2 21:58:32 UTC 2014
New revision: 273992
URL: https://svnweb.freebsd.org/changeset/base/273992

Log:
  Fix a bug which prevented ND6_IFF_IFDISABLED flag from clearing when
  the newly-added IPv6 address was /128.

  PR:	188032

Changes:
  head/sys/netinet6/in6.c
Comment 13 Hiroki Sato freebsd_committer freebsd_triage 2014-11-02 21:59:48 UTC
Committed in r273992.
Comment 14 Glen Barber freebsd_committer freebsd_triage 2015-07-08 18:16:08 UTC
Close PRs that have had a corresponding fix committed.
Comment 15 Hiroki Sato freebsd_committer freebsd_triage 2015-07-08 19:48:46 UTC
Still needs MFC.
Comment 16 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-21 09:37:38 UTC
There is a commit referencing this PR, but it's still not closed and has been inactive for some time. Closing the PR as fixed but feel free to re-open it if the issue hasn't been completely resolved.

Thanks