From 1a08736a8d922a124ad45d1e9f928525907acc8b Mon Sep 17 00:00:00 2001 From: mpi Date: Tue, 13 Oct 2015 09:59:37 +0000 Subject: [PATCH] Make sure RTF_LOCAL route entries are UP when added to the tree. This is required to maintain the original BSD behavior of locally configured addresses being always reacheable. Some interfaces are^w^W^Wem(4) is special and generally has a DOWN link state when configured by netstart(8). As a result all the route entries cloned/added before its link state goes to UP are also marked as DOWN. Note that this problem was not present when local addresses were attached to lo0. ok mikeb@ --- sys/net/route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/route.c b/sys/net/route.c index c993196e623..861a43294c9 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.249 2015/10/07 10:50:35 mpi Exp $ */ +/* $OpenBSD: route.c,v 1.250 2015/10/13 09:59:37 mpi Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -856,6 +856,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio, #ifndef SMALL_KERNEL /* Check the link state if the table supports it. */ if (rtable_mpath_capable(tableid, ndst->sa_family) && + !ISSET(rt->rt_flags, RTF_LOCAL) && (!LINK_STATE_IS_UP(ifa->ifa_ifp->if_link_state) || !ISSET(ifa->ifa_ifp->if_flags, IFF_UP))) { rt->rt_flags &= ~RTF_UP; -- 2.20.1