From 7f01046e64518429aebcbbac3a2cca2b04038ab5 Mon Sep 17 00:00:00 2001 From: friehm Date: Tue, 10 Jul 2018 10:55:21 +0000 Subject: [PATCH] Let kroute_matchgw() select the correct route before checking flags. OK claudio@ --- usr.sbin/ospf6d/kroute.c | 6 +++--- 1 file 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 @@ -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; -- 2.20.1