mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 15:07:51 +00:00
Merge pull request #8010 from ton31337/fix/drop_aggregate_as_attribute_if_malformed
bgpd: Drop aggregator_as attribute if malformed in case of BGP_AS_ZERO
This commit is contained in:
commit
d5b342eb75
@ -1750,17 +1750,18 @@ static int bgp_attr_aggregator(struct bgp_attr_parser_args *args)
|
|||||||
else
|
else
|
||||||
aggregator_as = stream_getw(peer->curr);
|
aggregator_as = stream_getw(peer->curr);
|
||||||
|
|
||||||
attr->aggregator_as = aggregator_as;
|
|
||||||
attr->aggregator_addr.s_addr = stream_get_ipv4(peer->curr);
|
|
||||||
|
|
||||||
/* Set atomic aggregate flag. */
|
|
||||||
attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_AGGREGATOR);
|
|
||||||
|
|
||||||
/* Codification of AS 0 Processing */
|
/* Codification of AS 0 Processing */
|
||||||
if (aggregator_as == BGP_AS_ZERO)
|
if (aggregator_as == BGP_AS_ZERO) {
|
||||||
flog_err(EC_BGP_ATTR_LEN,
|
flog_err(EC_BGP_ATTR_LEN,
|
||||||
"AGGREGATOR AS number is 0 for aspath: %s",
|
"%s: AGGREGATOR AS number is 0 for aspath: %s",
|
||||||
aspath_print(attr->aspath));
|
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. */
|
||||||
|
attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_AGGREGATOR);
|
||||||
|
}
|
||||||
|
|
||||||
return BGP_ATTR_PARSE_PROCEED;
|
return BGP_ATTR_PARSE_PROCEED;
|
||||||
}
|
}
|
||||||
@ -1784,16 +1785,18 @@ bgp_attr_as4_aggregator(struct bgp_attr_parser_args *args,
|
|||||||
}
|
}
|
||||||
|
|
||||||
aggregator_as = stream_getl(peer->curr);
|
aggregator_as = stream_getl(peer->curr);
|
||||||
*as4_aggregator_as = aggregator_as;
|
|
||||||
as4_aggregator_addr->s_addr = stream_get_ipv4(peer->curr);
|
|
||||||
|
|
||||||
attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_AS4_AGGREGATOR);
|
|
||||||
|
|
||||||
/* Codification of AS 0 Processing */
|
/* Codification of AS 0 Processing */
|
||||||
if (aggregator_as == BGP_AS_ZERO)
|
if (aggregator_as == BGP_AS_ZERO) {
|
||||||
flog_err(EC_BGP_ATTR_LEN,
|
flog_err(EC_BGP_ATTR_LEN,
|
||||||
"AS4_AGGREGATOR AS number is 0 for aspath: %s",
|
"%s: AS4_AGGREGATOR AS number is 0 for aspath: %s",
|
||||||
aspath_print(attr->aspath));
|
peer->host, aspath_print(attr->aspath));
|
||||||
|
} else {
|
||||||
|
*as4_aggregator_as = aggregator_as;
|
||||||
|
as4_aggregator_addr->s_addr = stream_get_ipv4(peer->curr);
|
||||||
|
|
||||||
|
attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_AS4_AGGREGATOR);
|
||||||
|
}
|
||||||
|
|
||||||
return BGP_ATTR_PARSE_PROCEED;
|
return BGP_ATTR_PARSE_PROCEED;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user