mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-28 17:01:51 +00:00
bgpd: fix aggregate route display
Based on RFC-4760, if NEXT_HOP attribute is not suppose to be set if MP_REACH_NLRI NLRI is used. for IPv4 aggregate route only NEXT_HOP attribute with ipv4 prefixlen needs to be set. Testing Done: Before fix: ---------- aggregate route: *> 184.123.0.0/16 ::(TORC11) 0 32768 i After fix: --------- aggregate route: *> 184.123.0.0/16 0.0.0.0(TORC11) 0 32768 i * i peerlink-3 0 100 0 i * uplink1 0 4435 5546 i 184.123.1.0/24 0.0.0.0(TORC11) 0 32768 i s> 184.123.8.0/22 0.0.0.0(TORC11) 0 32768 i Signed-off-by: Chirag Shah <chirag@nvidia.com>
This commit is contained in:
parent
cd845be6a7
commit
ff8bebd2a6
@ -1082,9 +1082,6 @@ struct attr *bgp_attr_aggregate_intern(
|
||||
attr.aspath = aspath_empty(bgp->asnotation);
|
||||
attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_AS_PATH);
|
||||
|
||||
/* Next hop attribute. */
|
||||
attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP);
|
||||
|
||||
if (community) {
|
||||
uint32_t gshut = COMMUNITY_GSHUT;
|
||||
|
||||
@ -1121,6 +1118,21 @@ struct attr *bgp_attr_aggregate_intern(
|
||||
attr.aggregator_as = bgp->as;
|
||||
attr.aggregator_addr = bgp->router_id;
|
||||
|
||||
/* Aggregate are done for IPv4/IPv6 so checking ipv4 family,
|
||||
* This should only be set for IPv4 AFI type
|
||||
* based on RFC-4760:
|
||||
* "An UPDATE message that carries no NLRI,
|
||||
* other than the one encoded in
|
||||
* the MP_REACH_NLRI attribute,
|
||||
* SHOULD NOT carry the NEXT_HOP
|
||||
* attribute"
|
||||
*/
|
||||
if (p->family == AF_INET) {
|
||||
/* Next hop attribute. */
|
||||
attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP);
|
||||
attr.mp_nexthop_len = IPV4_MAX_BYTELEN;
|
||||
}
|
||||
|
||||
/* Apply route-map */
|
||||
if (aggregate->rmap.name) {
|
||||
struct attr attr_tmp = attr;
|
||||
|
Loading…
Reference in New Issue
Block a user