diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2022-08-10 14:21:25 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2022-08-10 14:21:25 +0000 |
commit | 70f52e578b54c2e9d80f2255bb9c3130088a13e6 (patch) | |
tree | 539be85574903abd6d378304e72279eedefb8929 /usr.sbin | |
parent | 6a20ea86594315298e845a599e9a5fdf7d3cee60 (diff) |
Reverse NULL check in krVPN6_change()
This matches the VPN4 code and avoids a NULL deref in the else branch.
ok claudio
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/kroute.c | 4 |
1 files 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 <claudio@openbsd.org> @@ -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 { |