Roy Marples
2015-04-21 08:46:57 UTC
Hi List
As discussed here [1], a few people voiced their opinion that they
didn't like address removal when the carrier drops and would rather
re-negotiate at carrier up. The first step of doing this is to add IPv6
address flag semantics to IPv4 addresses.
This patch adds the following flags to IPv4 and mimics the IPv6
behaviour of the same flags:
IN_IFF_TENTATIVE
IN_IFF_DUPLICATED
IN_IFF_DETACHED
IN_IFF_NOTREADY (IN_IFF_TENTATIVE | IN_IFF_DUPLICATED)
ioctl SIOCGIFAFLAG_IN has been added to retrieve the flags using a ifreq
struct (ifaliasreq is probably better but then we run into compatibility
issues, also why IN_IFF_NODAD is not implemented).
ifconfig(8) has been modified to report the new flags and wait for
tentative to vanish via -w alongside the IPv6 addresses.
sysctl(8) now has these new values:
net.inet.ip.dad_count=3
net.inet.arp.debug=0
DAD is implemented according to RFC 5227.
A future patch could be made to implement address defence from the RFC,
but this is optional (although required for IPv4LL, but dhcpcd will
handle that).
It's easy to see this patch working, simply run ntpd, reboot and watch
it complain that it cannot bind to IPv4 tentative addresses.
Commentary welcome, especially on ideas of how to make IN_IFF_NODAD or
ifaliasreq work with the above.
Roy
[1] http://mail-index.netbsd.org/tech-net/2015/04/07/msg005053.html
As discussed here [1], a few people voiced their opinion that they
didn't like address removal when the carrier drops and would rather
re-negotiate at carrier up. The first step of doing this is to add IPv6
address flag semantics to IPv4 addresses.
This patch adds the following flags to IPv4 and mimics the IPv6
behaviour of the same flags:
IN_IFF_TENTATIVE
IN_IFF_DUPLICATED
IN_IFF_DETACHED
IN_IFF_NOTREADY (IN_IFF_TENTATIVE | IN_IFF_DUPLICATED)
ioctl SIOCGIFAFLAG_IN has been added to retrieve the flags using a ifreq
struct (ifaliasreq is probably better but then we run into compatibility
issues, also why IN_IFF_NODAD is not implemented).
ifconfig(8) has been modified to report the new flags and wait for
tentative to vanish via -w alongside the IPv6 addresses.
sysctl(8) now has these new values:
net.inet.ip.dad_count=3
net.inet.arp.debug=0
DAD is implemented according to RFC 5227.
A future patch could be made to implement address defence from the RFC,
but this is optional (although required for IPv4LL, but dhcpcd will
handle that).
It's easy to see this patch working, simply run ntpd, reboot and watch
it complain that it cannot bind to IPv4 tentative addresses.
Commentary welcome, especially on ideas of how to make IN_IFF_NODAD or
ifaliasreq work with the above.
Roy
[1] http://mail-index.netbsd.org/tech-net/2015/04/07/msg005053.html