When initializing addresses, reset the interface flags to 0. This fixes

an issue where point to point addresses that started down, and then came
up, were left with stale flags on one side of the point to point link.
This commit is contained in:
christos 2016-09-13 15:41:33 +00:00
parent 248bb5a5d7
commit acab31252a
2 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: in.c,v 1.179 2016/09/01 04:27:00 ozaki-r Exp $ */
/* $NetBSD: in.c,v 1.180 2016/09/13 15:41:33 christos 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.179 2016/09/01 04:27:00 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.180 2016/09/13 15:41:33 christos Exp $");
#include "arp.h"
@ -1065,6 +1065,7 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia,
*/
oldaddr = ia->ia_addr;
ia->ia_addr = *sin;
ia->ia4_flags = 0;
/* Set IN_IFF flags early for if_addr_init() */
if (hostIsNew && if_do_dad(ifp) && !in_nullhost(ia->ia_addr.sin_addr)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6.c,v 1.218 2016/09/02 15:57:54 roy Exp $ */
/* $NetBSD: in6.c,v 1.219 2016/09/13 15:41:34 christos Exp $ */
/* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */
/*
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.218 2016/09/02 15:57:54 roy Exp $");
__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.219 2016/09/13 15:41:34 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -1708,6 +1708,7 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia,
}
ia->ia_addr = *sin6;
ia->ia6_flags = 0;
if (ifacount <= 0 &&
(error = if_addr_init(ifp, &ia->ia_ifa, true)) != 0) {