Merge pull request #12204 from taspelund/soo_ip_fix

bgpd: Check for IP-format Site-of-Origin
This commit is contained in:
Donatas Abraitis 2022-10-27 07:27:41 +01:00 committed by GitHub
commit eeb83189b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2418,7 +2418,7 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
if (aspath_check_as_sets(attr->aspath)) if (aspath_check_as_sets(attr->aspath))
return false; return false;
/* If neighbor sso is configured, then check if the route has /* If neighbor soo is configured, then check if the route has
* SoO extended community and validate against the configured * SoO extended community and validate against the configured
* one. If they match, do not announce, to prevent routing * one. If they match, do not announce, to prevent routing
* loops. * loops.
@ -2431,6 +2431,8 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
if ((ecommunity_lookup(ecomm, ECOMMUNITY_ENCODE_AS, if ((ecommunity_lookup(ecomm, ECOMMUNITY_ENCODE_AS,
ECOMMUNITY_SITE_ORIGIN) || ECOMMUNITY_SITE_ORIGIN) ||
ecommunity_lookup(ecomm, ECOMMUNITY_ENCODE_AS4, ecommunity_lookup(ecomm, ECOMMUNITY_ENCODE_AS4,
ECOMMUNITY_SITE_ORIGIN) ||
ecommunity_lookup(ecomm, ECOMMUNITY_ENCODE_IP,
ECOMMUNITY_SITE_ORIGIN)) && ECOMMUNITY_SITE_ORIGIN)) &&
ecommunity_include(ecomm, ecomm_soo)) { ecommunity_include(ecomm, ecomm_soo)) {
if (bgp_debug_update(NULL, p, subgrp->update_group, 0)) if (bgp_debug_update(NULL, p, subgrp->update_group, 0))