]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix mpls nexthop announce to zebra
authorRyoga Saito <ryoga.saito@linecorp.com>
Wed, 22 Sep 2021 04:58:59 +0000 (04:58 +0000)
committerRyoga Saito <ryoga.saito@linecorp.com>
Wed, 22 Sep 2021 04:58:59 +0000 (04:58 +0000)
currently, has_valid_label is only used to check need to print debug,
but if route has normal nexthops and mpls nexthops, label information
will be printed even for normal nexthops.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
bgpd/bgp_zebra.c

index e8ca544c23718372eb661b9731841da1ab6fadfe..dc48629e1d1171f364aa30e44d95dbe113e5053a 100644 (file)
@@ -1219,7 +1219,6 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
        struct zapi_nexthop *api_nh;
        int nh_family;
        unsigned int valid_nh_count = 0;
-       int has_valid_label = 0;
        bool allow_recursion = false;
        int has_valid_sid = 0;
        uint8_t distance;
@@ -1434,7 +1433,6 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
                if (mpinfo->extra
                    && bgp_is_valid_label(&mpinfo->extra->label[0])
                    && !CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE)) {
-                       has_valid_label = 1;
                        label = label_pton(&mpinfo->extra->label[0]);
 
                        SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_LABEL);
@@ -1560,7 +1558,7 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
                        label_buf[0] = '\0';
                        eth_buf[0] = '\0';
                        segs_buf[0] = '\0';
-                       if (has_valid_label
+                       if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_LABEL)
                            && !CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE))
                                snprintf(label_buf, sizeof(label_buf),
                                        "label %u", api_nh->labels[0]);