From d33585cb4d9ccfb845b8cd7ce82c213af48291f9 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 17 Oct 2024 11:11:50 +0300 Subject: [PATCH] bgpd: Handle non-transitive extended communities for link-bandwidth If we received a non-transitive extended community (in this case it was extended link-bandwidth), we treated it as unknown because we didn't check for the transitive flag correctly. Signed-off-by: Donatas Abraitis --- bgpd/bgp_ecommunity.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c index 547dcdf7f3..e0bf196e79 100644 --- a/bgpd/bgp_ecommunity.c +++ b/bgpd/bgp_ecommunity.c @@ -1408,7 +1408,8 @@ char *ecommunity_ecom2str(struct ecommunity *ecom, int format, int filter) "FS:marking %u", *(pnt + 5)); } else unk_ecom = true; - } else if (type == ECOMMUNITY_ENCODE_AS_NON_TRANS) { + } else if (CHECK_FLAG(type, ECOMMUNITY_ENCODE_AS_NON_TRANS) || + CHECK_FLAG(type, ECOMMUNITY_FLAG_NON_TRANSITIVE)) { sub_type = *pnt++; if (sub_type == ECOMMUNITY_LINK_BANDWIDTH) ecommunity_lb_str(encbuf, sizeof(encbuf), pnt,