]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: fix bgp label value when static route used
authorPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 12 Apr 2023 13:51:25 +0000 (15:51 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 12 Apr 2023 15:45:48 +0000 (17:45 +0200)
The BGP local label value is not re-set when the prefix
is either a network or an aggregate prefix. Ensure to
get the appropriate label value each time the 'need_imp_null_label()'
function has to return true.

Fixes: 7ee70320d370 ("bgpd: add cli command to control explicit-null label usage")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_route.c

index b49206adceb5191b344b9dfd7ba74274a2844f21..91fb0c7801ab2f8b0e9bae294642c760ed1aa895 100644 (file)
@@ -3080,10 +3080,11 @@ static bool bgp_lu_need_null_label(struct bgp *bgp,
        if (new_select->sub_type == BGP_ROUTE_STATIC
            || new_select->sub_type == BGP_ROUTE_AGGREGATE
            || new_select->sub_type == BGP_ROUTE_REDISTRIBUTE)
-               return true;
+               goto need_null_label;
        else if (new_select->extra &&
                 bgp_is_valid_label(&new_select->extra->label[0]))
                return false;
+need_null_label:
        if (label == NULL)
                return true;
        if (!!CHECK_FLAG(bgp->flags, BGP_FLAG_LU_EXPLICIT_NULL))