diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-08-03 10:02:49 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-08-03 13:38:53 +0200 |
commit | 71bdae66b2c105302f7af9fc0c1deb657e2418d9 (patch) | |
tree | 82d433082f3a66e9c1a283c4289fb3af3a334802 /bgpd | |
parent | Merge pull request #9056 from askorichenko/test-dont-capability (diff) | |
download | frr-71bdae66b2c105302f7af9fc0c1deb657e2418d9.tar.xz frr-71bdae66b2c105302f7af9fc0c1deb657e2418d9.zip |
bgpd: Keep extcommunity bandwidth commands persistent in route-maps
~/frr# vtysh -c 'conf' -c 'route-map testas permit 10' -c 'set extcommunity bandwidth 321'
~/frr# vtysh -c 'show route-map testas' | grep 321
extcommunity bandwidth 321 non-transitive
~/frr# vtysh -c 'sh run' | grep 321
~/frr#
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_ecommunity.h | 6 | ||||
-rw-r--r-- | bgpd/bgp_routemap_nb_config.c | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/bgpd/bgp_ecommunity.h b/bgpd/bgp_ecommunity.h index 03b23fcd3..a9dc2aeaa 100644 --- a/bgpd/bgp_ecommunity.h +++ b/bgpd/bgp_ecommunity.h @@ -151,6 +151,12 @@ struct ecommunity_val_ipv6 { char val[IPV6_ECOMMUNITY_SIZE]; }; +enum ecommunity_lb_type { + EXPLICIT_BANDWIDTH, + CUMULATIVE_BANDWIDTH, + COMPUTED_BANDWIDTH +}; + #define ecom_length_size(X, Y) ((X)->size * (Y)) /* diff --git a/bgpd/bgp_routemap_nb_config.c b/bgpd/bgp_routemap_nb_config.c index 45f5c8f4b..398e7323d 100644 --- a/bgpd/bgp_routemap_nb_config.c +++ b/bgpd/bgp_routemap_nb_config.c @@ -25,6 +25,7 @@ #include "lib/routemap.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_routemap_nb.h" +#include "bgpd/bgp_ecommunity.h" /* Add bgp route map rule. */ static int bgp_route_match_add(struct route_map_index *index, @@ -2592,12 +2593,6 @@ lib_route_map_entry_set_action_rmap_set_action_comm_list_name_destroy( return NB_OK; } -enum e_community_lb_type { - EXPLICIT_BANDWIDTH, - CUMULATIVE_BANDWIDTH, - COMPUTED_BANDWIDTH -}; - /* * XPath: * /frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-lb @@ -2607,7 +2602,7 @@ lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_finish( struct nb_cb_apply_finish_args *args) { struct routemap_hook_context *rhc; - int lb_type; + enum ecommunity_lb_type lb_type; char str[VTY_BUFSIZ]; uint16_t bandwidth; |