Module Name:    src
Committed By:   roy
Date:           Tue Dec  4 20:46:56 UTC 2018

Modified Files:
        src/sys/netinet6: nd6_nbr.c

Log Message:
inet6: simplify NA DaD checking


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/netinet6/nd6_nbr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet6/nd6_nbr.c
diff -u src/sys/netinet6/nd6_nbr.c:1.158 src/sys/netinet6/nd6_nbr.c:1.159
--- src/sys/netinet6/nd6_nbr.c:1.158	Tue Dec  4 12:23:43 2018
+++ src/sys/netinet6/nd6_nbr.c	Tue Dec  4 20:46:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6_nbr.c,v 1.158 2018/12/04 12:23:43 roy Exp $	*/
+/*	$NetBSD: nd6_nbr.c,v 1.159 2018/12/04 20:46:56 roy Exp $	*/
 /*	$KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.158 2018/12/04 12:23:43 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.159 2018/12/04 20:46:56 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -661,20 +661,13 @@ nd6_na_input(struct mbuf *m, int off, in
 	 *
 	 * Otherwise, process as defined in RFC 2461.
 	 */
-	if (ifa &&
-	    (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_TENTATIVE))
-	{
-		nd6_dad_na_input(ifa);
-		ifa_release(ifa, &psref_ia);
-		ifa = NULL;
-		goto freeit;
-	}
-
-	/* Just for safety, maybe unnecessary. */
 	if (ifa) {
-		log(LOG_ERR,
-		    "nd6_na_input: duplicate IP6 address %s\n",
-		    IN6_PRINT(ip6buf, &taddr6));
+		if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_TENTATIVE)
+			nd6_dad_na_input(ifa);
+		else
+			log(LOG_ERR,
+			    "nd6_na_input: duplicate IP6 address %s\n",
+			    IN6_PRINT(ip6buf, &taddr6));
 		ifa_release(ifa, &psref_ia);
 		ifa = NULL;
 		goto freeit;

Reply via email to