summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-09-11 15:38:14 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-09-11 15:38:14 +0000
commit259e603113f75361257974b178d88bdde478ead2 (patch)
treedbb2add4594d1b570462eb318c59b614ee098624 /sys
parentcf18c9f15799720f35aea5ab721bc640303d31b1 (diff)
Apply the link state change hook to RTF_LOCAL routes.
Checking for rt_ifp is currently not enough because RTF_LOCAL routes still use a hack introduced in 1991 and have lo0ifp as rt_ifp pointer. So also check for rt_ifa->ifa_ifp in this case. ok claudio@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/route.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 634f843a19c..9d680d0d62e 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.234 2015/09/11 14:30:30 mpi Exp $ */
+/* $OpenBSD: route.c,v 1.235 2015/09/11 15:38:13 mpi Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -1737,8 +1737,9 @@ rt_if_linkstate_change(struct rtentry *rt, void *arg, u_int id)
{
struct ifnet *ifp = arg;
- if (rt->rt_ifp != ifp)
- return (0);
+ if ((rt->rt_ifp != ifp) &&
+ (rt->rt_ifa == NULL || rt->rt_ifa->ifa_ifp != ifp))
+ return (0);
if (LINK_STATE_IS_UP(ifp->if_link_state) && ifp->if_flags & IFF_UP) {
if (!(rt->rt_flags & RTF_UP)) {