]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Do not perform DAD on stf(4) interfaces.
authorMark Johnston <markj@FreeBSD.org>
Sat, 30 Mar 2019 18:00:44 +0000 (18:00 +0000)
committerMark Johnston <markj@FreeBSD.org>
Sat, 30 Mar 2019 18:00:44 +0000 (18:00 +0000)
commitca1163bd5f0c4216c99774a22e4fd40fc8c220c4
tree610751670812138ca40838d0bb19eda9c6ca292c
parent1c50bec8efc26884c31016fb033c7fbe4903860b
Do not perform DAD on stf(4) interfaces.

stf(4) interfaces are not multicast-capable so they can't perform DAD.
They also did not set IFF_DRV_RUNNING when an address was assigned, so
the logic in nd6_timer() would periodically flag such an address as
tentative, resulting in interface flapping.

Fix the problem by setting IFF_DRV_RUNNING when an address is assigned,
and do some related cleanup:
- In in6if_do_dad(), remove a redundant check for !UP || !RUNNING.
  There is only one caller in the tree, and it only looks at whether
  the return value is non-zero.
- Have in6if_do_dad() return false if the interface is not
  multicast-capable.
- Set ND6_IFF_NO_DAD when an address is assigned to an stf(4) interface
  and the interface goes UP as a result. Note that this is not
  sufficient to fix the problem because the new address is marked as
  tentative and DAD is started before in6_ifattach() is called.
  However, setting no_dad is formally correct.
- Change nd6_timer() to not flag addresses as tentative if no_dad is
  set.

This is based on a patch from Viktor Dukhovni.

Reported by: Viktor Dukhovni <ietf-dane@dukhovni.org>
Reviewed by: ae
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19751
sys/net/if_stf.c
sys/netinet6/in6.c
sys/netinet6/in6_ifattach.c
sys/netinet6/nd6.c