From 6330972769a361433bd99a7861420a652e154134 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 10 Aug 2022 14:21:24 +0000 Subject: [PATCH] Reverse NULL check in krVPN6_change() This matches the VPN4 code and avoids a NULL deref in the else branch. ok claudio --- usr.sbin/bgpd/kroute.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c index 164d71c0b85..3703e6044e0 100644 --- a/usr.sbin/bgpd/kroute.c +++ b/usr.sbin/bgpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.287 2022/08/03 08:16:05 claudio Exp $ */ +/* $OpenBSD: kroute.c,v 1.288 2022/08/10 14:21:24 tb Exp $ */ /* * Copyright (c) 2022 Claudio Jeker @@ -621,7 +621,7 @@ krVPN6_change(struct ktable *kt, struct kroute_full *kf) bcopy(&lo6, &kf->nexthop.v6, sizeof(kf->nexthop.v6)); if ((kr6 = kroute6_find(kt, &kf->prefix, kf->prefixlen, - kf->priority)) != NULL) { + kf->priority)) == NULL) { if (kroute_insert(kt, kf) == -1) return (-1); } else { -- 2.20.1