From 9bf61330273b5e152964577bd982418591ffc1ba Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 2 Nov 2020 10:14:48 -0500 Subject: [PATCH] bgpd: Multipath is always being allocated The multipath arrays are always being allocated, irrelevant if we actually have multipath information for a prefix. This is because the link bandwidth code was always adding the data structure. We should not be allocated multipath information unless we actually have multipath information Signed-off-by: Donald Sharp --- bgpd/bgp_mpath.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c index b7f516eaf7..ff5cfe05fb 100644 --- a/bgpd/bgp_mpath.c +++ b/bgpd/bgp_mpath.c @@ -412,8 +412,9 @@ static void bgp_path_info_mpath_lb_update(struct bgp_path_info *path, bool set, struct bgp_path_info_mpath *mpath; if ((mpath = path->mpath) == NULL) { - if (!set) + if (!set || (cum_bw == 0 && !all_paths_lb)) return; + mpath = bgp_path_info_mpath_get(path); if (!mpath) return; -- 2.39.5