Author: hiren
Date: Fri May 8 08:35:06 2015
New Revision: 282622
URL: https://svnweb.freebsd.org/changeset/base/282622
Log:
MFC r261708, r261847, r268525, r274316, r274347, r275593,
r276844, r276847, r279531, r279559, r279564, r279676
A bunch of IPv6 fixes by melifaro, hrs and ae
Major changes:
Simplify nd6_output_lle()
Add refcounting to DAD and fix races and other errors
Implement Enhanced DAD algorithm for IPv6
Suggested by: ae
Tested by:Jason Wolfe j at nitrology.com
Sponsored by: Limelight Networks
Modified:
stable/10/sbin/ifconfig/af_inet6.c
stable/10/sbin/ifconfig/af_nd6.c
stable/10/sbin/ifconfig/ifconfig.8
stable/10/sys/netinet/icmp6.h
stable/10/sys/netinet6/in6.c
stable/10/sys/netinet6/nd6.c
stable/10/sys/netinet6/nd6.h
stable/10/sys/netinet6/nd6_nbr.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sbin/ifconfig/af_inet6.c
==
--- stable/10/sbin/ifconfig/af_inet6.c Fri May 8 06:02:23 2015
(r282621)
+++ stable/10/sbin/ifconfig/af_inet6.c Fri May 8 08:35:06 2015
(r282622)
@@ -483,6 +483,10 @@ static struct cmd inet6_cmds[] = {
DEF_CMD(-auto_linklocal,-ND6_IFF_AUTO_LINKLOCAL,setnd6flags),
DEF_CMD(no_prefer_iface,ND6_IFF_NO_PREFER_IFACE,setnd6flags),
DEF_CMD(-no_prefer_iface,-ND6_IFF_NO_PREFER_IFACE,setnd6flags),
+ DEF_CMD(no_dad, ND6_IFF_NO_DAD, setnd6flags),
+ DEF_CMD(-no_dad, -ND6_IFF_NO_DAD,setnd6flags),
+ DEF_CMD(ignoreloop, ND6_IFF_IGNORELOOP, setnd6flags),
+ DEF_CMD(-ignoreloop, -ND6_IFF_IGNORELOOP,setnd6flags),
DEF_CMD_ARG(pltime, setip6pltime),
DEF_CMD_ARG(vltime, setip6vltime),
DEF_CMD(eui64,0, setip6eui64),
Modified: stable/10/sbin/ifconfig/af_nd6.c
==
--- stable/10/sbin/ifconfig/af_nd6.cFri May 8 06:02:23 2015
(r282621)
+++ stable/10/sbin/ifconfig/af_nd6.cFri May 8 08:35:06 2015
(r282622)
@@ -58,7 +58,8 @@ static const char rcsid[] =
#defineMAX_SYSCTL_TRY 5
#defineND6BITS \020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE \
\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL \
- \007NO_RADR\010NO_PREFER_IFACE\020DEFAULTIF
+ \007NO_RADR\010NO_PREFER_IFACE\011IGNORELOOP\012NO_DAD \
+ \020DEFAULTIF
static int isnd6defif(int);
void setnd6flags(const char *, int, int, const struct afswtch *);
Modified: stable/10/sbin/ifconfig/ifconfig.8
==
--- stable/10/sbin/ifconfig/ifconfig.8 Fri May 8 06:02:23 2015
(r282621)
+++ stable/10/sbin/ifconfig/ifconfig.8 Fri May 8 08:35:06 2015
(r282622)
@@ -28,7 +28,7 @@
.\ From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
.\ $FreeBSD$
.\
-.Dd September 9, 2014
+.Dd March 6, 2015
.Dt IFCONFIG 8
.Os
.Sh NAME
@@ -736,6 +736,20 @@ outgoing interface.
.It Cm -no_prefer_iface
Clear a flag
.Cm no_prefer_iface .
+.It Cm no_dad
+Set a flag to disable Duplicate Address Detection.
+.It Cm -no_dad
+Clear a flag
+.Cm no_dad .
+.It Cm ignoreloop
+Set a flag to disable loopback detection in Enhanced Duplicate Address
+Detection Algorithm.
+When this flag is set,
+Duplicate Address Detection will stop in a finite number of probings
+even if a loopback configuration is detected.
+.It Cm -ignoreloop
+Clear a flag
+.Cm ignoreloop .
.El
.Pp
The following parameters are specific for IPv6 addresses.
Modified: stable/10/sys/netinet/icmp6.h
==
--- stable/10/sys/netinet/icmp6.h Fri May 8 06:02:23 2015
(r282621)
+++ stable/10/sys/netinet/icmp6.h Fri May 8 08:35:06 2015
(r282622)
@@ -297,9 +297,11 @@ struct nd_opt_hdr {/* Neighbor discove
#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_tnd_opt_pi_type;
@@ -330,6 +332,16 @@ struct nd_opt_mtu {/* MTU option */
u_int32_t nd_opt_mtu_mtu;
} __packed;
+#defineND_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