summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfriehm <friehm@cvs.openbsd.org>2018-07-10 10:55:22 +0000
committerfriehm <friehm@cvs.openbsd.org>2018-07-10 10:55:22 +0000
commitd04b15d76bbfa01bacd4b617a5f8e50cf8a02e1b (patch)
tree375be949ea722363664b4f02779a99354beb0bf0
parent9fddc18ca5f9e7663530b8de352153c62ebd3d76 (diff)
Let kroute_matchgw() select the correct route before checking flags.
OK claudio@
-rw-r--r--usr.sbin/ospf6d/kroute.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ospf6d/kroute.c b/usr.sbin/ospf6d/kroute.c
index 42818186e5e..833ef98d1d2 100644
--- a/usr.sbin/ospf6d/kroute.c
+++ b/usr.sbin/ospf6d/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.54 2018/02/08 21:37:36 benno Exp $ */
+/* $OpenBSD: kroute.c,v 1.55 2018/07/10 10:55:21 friehm Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -1507,8 +1507,6 @@ add:
if ((kr = kroute_find(&prefix, prefixlen, prio)) ==
NULL)
continue;
- if (!(kr->r.flags & F_KERNEL))
- continue;
/* get the correct route */
okr = kr;
if (mpath && (kr = kroute_matchgw(kr, &nexthop,
@@ -1517,6 +1515,8 @@ add:
" not found");
return (-1);
}
+ if (!(kr->r.flags & F_KERNEL))
+ continue;
if (kroute_remove(kr) == -1)
return (-1);
break;