Module Name:    src
Committed By:   ozaki-r
Date:           Fri Apr  6 16:01:16 UTC 2018

Modified Files:
        src/sys/netinet: in.c

Log Message:
Revert the previous two commits as per roy@'s request

It broke the ip_dad_count > 0 case unexpectedly.


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 src/sys/netinet/in.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/netinet/in.c
diff -u src/sys/netinet/in.c:1.225 src/sys/netinet/in.c:1.226
--- src/sys/netinet/in.c:1.225	Fri Apr  6 09:20:29 2018
+++ src/sys/netinet/in.c	Fri Apr  6 16:01:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.225 2018/04/06 09:20:29 ozaki-r Exp $	*/
+/*	$NetBSD: in.c,v 1.226 2018/04/06 16:01:16 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.225 2018/04/06 09:20:29 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.226 2018/04/06 16:01:16 ozaki-r Exp $");
 
 #include "arp.h"
 
@@ -1143,15 +1143,15 @@ in_ifinit(struct ifnet *ifp, struct in_i
 	 * We need to do this early because they maybe adjusted
 	 * by if_addr_init depending on the address.
 	 */
-	if (ia->ia4_flags & IN_IFF_DUPLICATED)
+	if (ia->ia4_flags & IN_IFF_DUPLICATED) {
+		ia->ia4_flags &= ~IN_IFF_DUPLICATED;
 		hostIsNew = 1;
-	ia->ia4_flags = 0;
-	if (ip_dad_count > 0) {
-		if (ifp->if_link_state == LINK_STATE_DOWN)
-			ia->ia4_flags |= IN_IFF_DETACHED;
-		else if (hostIsNew && if_do_dad(ifp))
-			ia->ia4_flags |= IN_IFF_TRYTENTATIVE;
 	}
+	if (ifp->if_link_state == LINK_STATE_DOWN) {
+		ia->ia4_flags |= IN_IFF_DETACHED;
+		ia->ia4_flags &= ~IN_IFF_TENTATIVE;
+	} else if (hostIsNew && if_do_dad(ifp))
+		ia->ia4_flags |= IN_IFF_TRYTENTATIVE;
 
 	/*
 	 * Give the interface a chance to initialize

Reply via email to