Nonce has to be non-NULL for DAD even if net.inet6.ip6.dad_enhanced=0.

This commit is contained in:
Hiroki Sato 2015-03-03 04:28:19 +00:00
parent 429b844ba6
commit 8d56075939
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=279559

View File

@ -1528,7 +1528,6 @@ nd6_dad_ns_output(struct dadq *dp, struct ifaddr *ifa)
{
struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa;
struct ifnet *ifp = ifa->ifa_ifp;
uint8_t *nonce;
int i;
dp->dad_ns_tcount++;
@ -1543,7 +1542,6 @@ nd6_dad_ns_output(struct dadq *dp, struct ifaddr *ifa)
if (V_dad_enhanced != 0) {
for (i = 0; i < ND_OPT_NONCE_LEN32; i++)
dp->dad_nonce[i] = arc4random();
nonce = (uint8_t *)&dp->dad_nonce[0];
/*
* XXXHRS: Note that in the case that
* DupAddrDetectTransmits > 1, multiple NS messages with
@ -1552,9 +1550,9 @@ nd6_dad_ns_output(struct dadq *dp, struct ifaddr *ifa)
* the latest nonce on the sender side. Practically it
* should work well in almost all cases.
*/
} else
nonce = NULL;
nd6_ns_output(ifp, NULL, &ia->ia_addr.sin6_addr, NULL, nonce);
}
nd6_ns_output(ifp, NULL, &ia->ia_addr.sin6_addr, NULL,
(uint8_t *)&dp->dad_nonce[0]);
}
static void