Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Don't setup DaD for INADDR_ANY



details:   https://anonhg.NetBSD.org/src/rev/99262eb1471b
branches:  trunk
changeset: 347775:99262eb1471b
user:      roy <roy%NetBSD.org@localhost>
date:      Fri Sep 16 09:59:45 2016 +0000

description:
Don't setup DaD for INADDR_ANY

diffstat:

 sys/netinet/if_arp.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r c90ffcfbb9b3 -r 99262eb1471b sys/netinet/if_arp.c
--- a/sys/netinet/if_arp.c      Fri Sep 16 09:25:30 2016 +0000
+++ b/sys/netinet/if_arp.c      Fri Sep 16 09:59:45 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_arp.c,v 1.224 2016/09/15 18:17:29 roy Exp $ */
+/*     $NetBSD: if_arp.c,v 1.225 2016/09/16 09:59:45 roy Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.224 2016/09/15 18:17:29 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.225 2016/09/16 09:59:45 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1476,10 +1476,16 @@
        ifa->ifa_flags |= RTF_CONNECTED;
 
        /* ARP will handle DAD for this address. */
-       if (ia->ia4_flags & IN_IFF_TRYTENTATIVE) {
-               ia->ia4_flags |= IN_IFF_TENTATIVE;
+       if (in_nullhost(*ip)) {
+               if (ia->ia_dad_stop != NULL)    /* safety */
+                       ia->ia_dad_stop(ifa);
+               ia->ia_dad_start = NULL;
+               ia->ia_dad_stop = NULL;
+       } else {
                ia->ia_dad_start = arp_dad_start;
                ia->ia_dad_stop = arp_dad_stop;
+               if (ia->ia4_flags & IN_IFF_TRYTENTATIVE)
+                       ia->ia4_flags |= IN_IFF_TENTATIVE;
        }
 }
 



Home | Main Index | Thread Index | Old Index