Make sure RTF_LOCAL route entries are UP when added to the tree.
authormpi <mpi@openbsd.org>
Tue, 13 Oct 2015 09:59:37 +0000 (09:59 +0000)
committermpi <mpi@openbsd.org>
Tue, 13 Oct 2015 09:59:37 +0000 (09:59 +0000)
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

index c993196..861a432 100644 (file)
@@ -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;