diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2021-02-05 12:33:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-05 12:33:29 -0500 |
| commit | 503f20e40e26e6c4cde3d4fe92ec6379f57b9852 (patch) | |
| tree | 1cc4317d9bfc06cac10b3390dceb2a2005cf206f | |
| parent | 6ddbc710ccfee96e2e0cefd885154b5e978f7e73 (diff) | |
| parent | e836423849114df42643e6a4ce20b7ec75dfae35 (diff) | |
Merge pull request #8019 from ton31337/fix/bgpd_aggregator_0
bgpd: Unset only aggregator flag when AGGREGATOR_AS is 0
| -rw-r--r-- | bgpd/bgp_attr.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 48315cbaab..3e63ed483a 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -1750,18 +1750,16 @@ static int bgp_attr_aggregator(struct bgp_attr_parser_args *args) else aggregator_as = stream_getw(peer->curr); + attr->aggregator_as = aggregator_as; + attr->aggregator_addr.s_addr = stream_get_ipv4(peer->curr); + /* Codification of AS 0 Processing */ - if (aggregator_as == BGP_AS_ZERO) { + if (aggregator_as == BGP_AS_ZERO) flog_err(EC_BGP_ATTR_LEN, "%s: AGGREGATOR AS number is 0 for aspath: %s", peer->host, aspath_print(attr->aspath)); - } else { - attr->aggregator_as = aggregator_as; - attr->aggregator_addr.s_addr = stream_get_ipv4(peer->curr); - - /* Set atomic aggregate flag. */ + else attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_AGGREGATOR); - } return BGP_ATTR_PARSE_PROCEED; } @@ -1786,17 +1784,16 @@ bgp_attr_as4_aggregator(struct bgp_attr_parser_args *args, aggregator_as = stream_getl(peer->curr); + *as4_aggregator_as = aggregator_as; + as4_aggregator_addr->s_addr = stream_get_ipv4(peer->curr); + /* Codification of AS 0 Processing */ - if (aggregator_as == BGP_AS_ZERO) { + if (aggregator_as == BGP_AS_ZERO) flog_err(EC_BGP_ATTR_LEN, "%s: AS4_AGGREGATOR AS number is 0 for aspath: %s", peer->host, aspath_print(attr->aspath)); - } else { - *as4_aggregator_as = aggregator_as; - as4_aggregator_addr->s_addr = stream_get_ipv4(peer->curr); - + else attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_AS4_AGGREGATOR); - } return BGP_ATTR_PARSE_PROCEED; } |
