Page MenuHomeFreeBSD

Separate ioctl address prefix management from RA prefix management as we have no API for controlling the latter.
Needs ReviewPublic

Authored by guyyur_gmail.com on May 12 2018, 6:18 PM.
Tags
None
Referenced Files
F102658407: D15406.id77828.diff
Fri, Nov 15, 11:22 AM
Unknown Object (File)
Thu, Nov 14, 9:15 AM
Unknown Object (File)
Wed, Oct 30, 4:16 PM
Unknown Object (File)
Thu, Oct 24, 9:41 AM
Unknown Object (File)
Sun, Oct 20, 4:31 PM
Unknown Object (File)
Oct 10 2024, 7:18 AM
Unknown Object (File)
Oct 10 2024, 7:17 AM
Unknown Object (File)
Oct 10 2024, 7:17 AM
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This fixes a long standing problem where addresses added with non /128
prefixes and non infinite address lifetimes would register a prefix route
which would expire. Subsequent calls set new lifetimes for the same address
would not affect the prefix route management, so once expired, the
prefix route would be impossible to add back as the kernel would remove it.

Based on NetBSD changes (and reusing the commit message):
sys/netinet6/in6.c 1.216
sys/netinet6/in6.c 1.217
sys/netinet6/in6.c 1.218
sys/netinet6/in6_ifattach.c 1.104
sys/netinet6/nd6_rtr.c 1.119

Also fixes a panic with INVARIANTS set and running "ndp -P"
after an IPv6 address is manually added and the same prefix
for the address is learned via router advertisment.

#11 0xffffffff805d42b0 in kassert_panic (fmt=0xffffffff80939e3a "prefix %p has referencing addresses")

at /usr/src/sys/kern/kern_shutdown.c:723

#12 0xffffffff807d4049 in nd6_prefix_del (pr=0xfffff800043c0400) at /usr/src/sys/netinet6/nd6_rtr.c:1189
#13 0xffffffff807caf38 in nd6_ioctl (cmd=<optimized out>, data=<optimized out>, ifp=0xfffff80002337000)

at /usr/src/sys/netinet6/nd6.c:1831

PR: 195197

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

replace TAILQ_FOREACH with CK_STAILQ_FOREACH in in6_ifremprefix

rebase the changes against D23695, dropping the use of RTF_CONNECTED

update after rtinit split/removal changes

Update changes to mask destination address before calling rib_handle_ifaddr_info

rib_handle_ifaddr_info calls add_route which fails with ENOMEM when adding unmasked
destination if the route already exists and there is also a loopback route installed.
lookup_prefix in add_route is not masking the address so do the masking
before calling rib_handle_ifaddr_info.