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 <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2024-10-17 11:11:50 +03:00
parent fd6f46e9fd
commit d33585cb4d

View File

@ -1408,7 +1408,8 @@ char *ecommunity_ecom2str(struct ecommunity *ecom, int format, int filter)
"FS:marking %u", *(pnt + 5)); "FS:marking %u", *(pnt + 5));
} else } else
unk_ecom = true; 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++; sub_type = *pnt++;
if (sub_type == ECOMMUNITY_LINK_BANDWIDTH) if (sub_type == ECOMMUNITY_LINK_BANDWIDTH)
ecommunity_lb_str(encbuf, sizeof(encbuf), pnt, ecommunity_lb_str(encbuf, sizeof(encbuf), pnt,