struct kroute_full is the external representation of kroutes.
It includes the routing label as a string. For some reason there was also
a labelid field but that one is not used and needed, the labelid is an
internal id that has no value for any other process.

Just remove the field and the two places where it was set.
-- 
:wq Claudio

Index: bgpd.h
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/bgpd.h,v
retrieving revision 1.420
diff -u -p -r1.420 bgpd.h
--- bgpd.h      23 Feb 2022 11:20:35 -0000      1.420
+++ bgpd.h      3 Mar 2022 10:08:55 -0000
@@ -674,7 +674,6 @@ struct kroute_full {
        struct bgpd_addr        prefix;
        struct bgpd_addr        nexthop;
        char                    label[RTLABEL_LEN];
-       uint16_t                labelid;
        uint16_t                flags;
        u_short                 ifindex;
        uint8_t                 prefixlen;
Index: kroute.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/kroute.c,v
retrieving revision 1.242
diff -u -p -r1.242 kroute.c
--- kroute.c    6 Feb 2022 09:51:19 -0000       1.242
+++ kroute.c    3 Mar 2022 10:12:39 -0000
@@ -1625,7 +1625,6 @@ kr_tofull(struct kroute *kr)
        kf.nexthop.aid = AID_INET;
        kf.nexthop.v4.s_addr = kr->nexthop.s_addr;
        strlcpy(kf.label, rtlabel_id2name(kr->labelid), sizeof(kf.label));
-       kf.labelid = kr->labelid;
        kf.flags = kr->flags;
        kf.ifindex = kr->ifindex;
        kf.prefixlen = kr->prefixlen;
@@ -1646,7 +1645,6 @@ kr6_tofull(struct kroute6 *kr6)
        kf.nexthop.aid = AID_INET6;
        memcpy(&kf.nexthop.v6, &kr6->nexthop, sizeof(struct in6_addr));
        strlcpy(kf.label, rtlabel_id2name(kr6->labelid), sizeof(kf.label));
-       kf.labelid = kr6->labelid;
        kf.flags = kr6->flags;
        kf.ifindex = kr6->ifindex;
        kf.prefixlen = kr6->prefixlen;

Reply via email to