summaryrefslogtreecommitdiff
path: root/bgpd/bgp_mpath.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-08-29 21:54:13 +0300
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-08-30 14:21:49 +0300
commit27aa23a43b9922b8f90c324e2f6483b1cffa6aec (patch)
treeb9b80497d09f0826a00651614c5985ee212b8d87 /bgpd/bgp_mpath.c
parent8dbe9214588529872904c433834b3a6b61bc5aa3 (diff)
bgpd: Add `neighbor PEER link-bw-encoding-ieee`
This is to avoid breaking changes between existing deployments of extended community for bandwidth encoding. By default FRR uses uint32 to encode bandwidth, which is not as the draft requires (IEEE floating-point). This switch enables the required encoding per-peer. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'bgpd/bgp_mpath.c')
-rw-r--r--bgpd/bgp_mpath.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c
index 8127428bc7..1d727d267a 100644
--- a/bgpd/bgp_mpath.c
+++ b/bgpd/bgp_mpath.c
@@ -610,7 +610,8 @@ void bgp_path_info_mpath_update(struct bgp_dest *dest,
prev_mpath = cur_mpath;
mpath_count++;
if (ecommunity_linkbw_present(
- cur_mpath->attr->ecommunity, &bwval))
+ cur_mpath->attr->ecommunity,
+ &bwval))
cum_bw += bwval;
else
all_paths_lb = false;
@@ -699,7 +700,8 @@ void bgp_path_info_mpath_update(struct bgp_dest *dest,
mpath_changed = 1;
mpath_count++;
if (ecommunity_linkbw_present(
- new_mpath->attr->ecommunity, &bwval))
+ new_mpath->attr->ecommunity,
+ &bwval))
cum_bw += bwval;
else
all_paths_lb = false;
@@ -721,9 +723,9 @@ void bgp_path_info_mpath_update(struct bgp_dest *dest,
if (new_best) {
bgp_path_info_mpath_count_set(new_best, mpath_count - 1);
- if (mpath_count <= 1 ||
- !ecommunity_linkbw_present(
- new_best->attr->ecommunity, &bwval))
+ if (mpath_count <= 1
+ || !ecommunity_linkbw_present(new_best->attr->ecommunity,
+ &bwval))
all_paths_lb = false;
else
cum_bw += bwval;