]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix unsetting of multipath as-set
authorEmanuele Di Pascale <emanuele@voltanet.io>
Thu, 7 Jan 2021 13:46:59 +0000 (14:46 +0100)
committerEmanuele Di Pascale <emanuele@voltanet.io>
Mon, 11 Jan 2021 09:15:18 +0000 (10:15 +0100)
in the nortbound callback for the boolean leaf multi-path-as-set, the
actual value of the leaf was being ignored. As a result, going from
as-set to no-as-set was having no effect.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
bgpd/bgp_nb_config.c

index bee96332972c44ee1a614eca64738dd8cea59b8d..eb2f70fff13194c50fc2334a524c4e7f18e7f3ab 100644 (file)
@@ -894,6 +894,9 @@ int bgp_global_route_selection_options_allow_multiple_as_modify(
                                                "../multi-path-as-set")) {
                                SET_FLAG(bgp->flags,
                                         BGP_FLAG_MULTIPATH_RELAX_AS_SET);
+                       } else {
+                               UNSET_FLAG(bgp->flags,
+                                          BGP_FLAG_MULTIPATH_RELAX_AS_SET);
                        }
                } else {
                        UNSET_FLAG(bgp->flags, BGP_FLAG_ASPATH_MULTIPATH_RELAX);
@@ -923,15 +926,10 @@ int bgp_global_route_selection_options_multi_path_as_set_modify(
                return NB_OK;
        case NB_EV_APPLY:
                bgp = nb_running_get_entry(args->dnode, NULL, true);
-
-               if (!CHECK_FLAG(bgp->flags, BGP_FLAG_MULTIPATH_RELAX_AS_SET)) {
+               if (yang_dnode_get_bool(args->dnode, NULL))
                        SET_FLAG(bgp->flags, BGP_FLAG_MULTIPATH_RELAX_AS_SET);
-
-               } else
-                       zlog_debug(
-                               "%s multi-path-as-set as part of allow-multiple-as modify cb.",
-                               __func__);
-
+               else
+                       UNSET_FLAG(bgp->flags, BGP_FLAG_MULTIPATH_RELAX_AS_SET);
                break;
        }