Page MenuHomeFreeBSD

ndp: Add support for Optimistic DAD (RFC 4429)
Needs ReviewPublic

Authored by pouria on Tue, Feb 10, 6:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 3, 1:06 AM
Unknown Object (File)
Sat, Feb 21, 2:49 PM
Unknown Object (File)
Sat, Feb 21, 2:49 PM
Unknown Object (File)
Sat, Feb 21, 6:45 AM
Unknown Object (File)
Fri, Feb 20, 8:48 PM
Unknown Object (File)
Thu, Feb 19, 12:31 AM
Unknown Object (File)
Tue, Feb 17, 6:29 PM
Unknown Object (File)
Tue, Feb 17, 4:17 PM

Details

Reviewers
zlei
bz
glebius
madpilot
melifaro
Group Reviewers
network
Summary

Implement optimistic address based on
RFC 4429.
This revision is not really depends on D55015.
However, their IPV6CTL numbers could have
conflicts if I didn't use GRAND as parent commit.

Here is my notes to make reviewing easier.

note on ifconfig: since we don't want the user
to manually set the optimistic flag (RFC 4429 section 3.1),
I didn't update the ifconfig manual just like tentative flag.

note on RFC 4429 Sections:
2.1: done (in6_ifawithifp)
2.2.1: done (nd6_ns_input)
2.2.2: done (nd6_ns_output_fib)
2.3 + 3.2.4: partially without violation (nd6_ns_output_fib).
Since we don't directly have the source address of packet
during nd6_resolve.
I can't return lle of default router without reading
inside the mbuf to get our own source address, AND I don't
want to pullup the mbuf receiving in nd6_resolve.
However, this doesn't violate any rules and *rare* to happen.
if such situation happens, It will behave like before (tenative) if
and only if we don't have an ndp cache entry AND there is no
other address available to be source address of NS.
2.4 + 2.2.3: since RS only sends by rtsold(8), I will
fix it on another review.
In summary, rtsold complains when we don't have link-local
which is *rare* and *not default behavior*.
if link-local is not available it MAY send RS with optimistic
source if other addresses are not available. (rtsold/if.c:166).
3.1: done (in6_update_ifa_internal)
3.2: done
3.3: done

Test Plan

increase dad_count to delay removal of
optimistic flag from address, then enable optimistic
and slaac/tempaddr tunable together:

sysctl net.inet6.ip6.dad_count=10
sysctl net.inet6.ip6.use_optimistic=1
sysctl net.inet6.ip6.use_tempaddr=1

monitor packets via tcpdump -vni vtnet0 icmp6 to verify intended behavior.
You can manually set optimistic flag via ifconfig or restart the interface.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 70612
Build 67495: arc lint + arc unit

Event Timeline

Rebase to main. follow parent commit update and resolve conflict with a2eb0894b79b.

markj added inline comments.
sbin/ifconfig/af_inet6.c
736

Do these need to be documented in ifconfig.8?

usr.sbin/rtsold/if.c
166

Is this something that needs to be addressed in this diff?

sbin/ifconfig/af_inet6.c
736

I explained in summary above:
since we don't want the user to manually set the optimistic flag (RFC 4429 section 3.1), I didn't update the ifconfig manual just like tentative flag.

usr.sbin/rtsold/if.c
166

Not in this diff, I just added the comment for future. I explained this one in summary above too.
RFC 4429 2.4 + 2.2.3 said:
Never using an Optimistic Address as the source address of a Router Solicitation with a SLLAO.

Since RS only sends by rtsold(8), I'll fix it on another review.
In summary, rtsold complains when we don't have link-local which is *rare* and *not default behavior*.
if link-local is not available it MAY send RS with optimistic source if other addresses are not available. (rtsold/if.c:166).

I have been testing this patch on a couple of computers for over a week now, and everything seems to work fine (at least I see no regression).