The below matches the VPN4 code and makes more sense given that we deref
kr6 in the else block.

Index: kroute.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/kroute.c,v
retrieving revision 1.287
diff -u -p -U5 -r1.287 kroute.c
--- kroute.c    3 Aug 2022 08:16:05 -0000       1.287
+++ kroute.c    10 Aug 2022 13:56:28 -0000
@@ -619,11 +619,11 @@ krVPN6_change(struct ktable *kt, struct 
        /* for blackhole and reject routes nexthop needs to be ::1 */
        if (kf->flags & (F_BLACKHOLE|F_REJECT))
                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 {
                kr6->mplslabel = mplslabel;
                kr6->ifindex = kf->ifindex;

Reply via email to