diff options
author | Hiroki Sato <hrs@FreeBSD.org> | 2015-03-02 17:30:26 +0000 |
---|---|---|
committer | Hiroki Sato <hrs@FreeBSD.org> | 2015-03-02 17:30:26 +0000 |
commit | 11d8451df3d33c5bb876da719ac65e8fc64154f6 (patch) | |
tree | 4e61fd1366b02909415f2f7f69207fa6bfdd5f3b /sys/netinet/icmp6.h | |
parent | 1d0f6813acadfb6a48623a511a0ec820f125ee34 (diff) | |
download | src-11d8451df3d33c5bb876da719ac65e8fc64154f6.tar.gz src-11d8451df3d33c5bb876da719ac65e8fc64154f6.zip |
Implement Enhanced DAD algorithm for IPv6 described in
draft-ietf-6man-enhanced-dad-13.
This basically adds a random nonce option (RFC 3971) to NS messages
for DAD probe to detect a looped back packet. This looped back packet
prevented DAD on some pseudo-interfaces which aggregates multiple L2 links
such as lagg(4).
The length of the nonce is set to 6 bytes. This algorithm can be disabled by
setting net.inet6.ip6.dad_enhanced sysctl to 0 in a per-vnet basis.
Reported by: hiren
Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D1835
Notes
Notes:
svn path=/head/; revision=279531
Diffstat (limited to 'sys/netinet/icmp6.h')
-rw-r--r-- | sys/netinet/icmp6.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/netinet/icmp6.h b/sys/netinet/icmp6.h index 15f4c2dfa64f..979c8fd65929 100644 --- a/sys/netinet/icmp6.h +++ b/sys/netinet/icmp6.h @@ -297,9 +297,11 @@ struct nd_opt_hdr { /* Neighbor discovery option header */ #define ND_OPT_PREFIX_INFORMATION 3 #define ND_OPT_REDIRECTED_HEADER 4 #define ND_OPT_MTU 5 +#define ND_OPT_NONCE 14 /* RFC 3971 */ #define ND_OPT_ROUTE_INFO 24 /* RFC 4191 */ #define ND_OPT_RDNSS 25 /* RFC 6106 */ #define ND_OPT_DNSSL 31 /* RFC 6106 */ +#define ND_OPT_MAX 31 struct nd_opt_prefix_info { /* prefix information */ u_int8_t nd_opt_pi_type; @@ -330,6 +332,16 @@ struct nd_opt_mtu { /* MTU option */ u_int32_t nd_opt_mtu_mtu; } __packed; +#define ND_OPT_NONCE_LEN ((1 * 8) - 2) +#if ((ND_OPT_NONCE_LEN + 2) % 8) != 0 +#error "(ND_OPT_NONCE_LEN + 2) must be a multiple of 8." +#endif +struct nd_opt_nonce { /* nonce option */ + u_int8_t nd_opt_nonce_type; + u_int8_t nd_opt_nonce_len; + u_int8_t nd_opt_nonce[ND_OPT_NONCE_LEN]; +} __packed; + struct nd_opt_route_info { /* route info */ u_int8_t nd_opt_rti_type; u_int8_t nd_opt_rti_len; |