summaryrefslogtreecommitdiff
path: root/bgpd/bgp_updgrp_packet.c
diff options
context:
space:
mode:
authorEnke Chen <enchen@paloaltonetworks.com>2024-10-21 18:03:08 -0700
committerEnke Chen <enchen@paloaltonetworks.com>2024-10-21 18:03:08 -0700
commitfc82d7750f3cc54855ca399f3060428b66e1fbec (patch)
tree312255a1b031bfeabf404b41dc692749ab68e90b /bgpd/bgp_updgrp_packet.c
parent7e7f65cc00b13108e260bef329fc17374ea384f6 (diff)
bgpd: fix AIGP calculation in route advertisement
Currently the AIGP is always incremented when a route with the attribute is advertised. That is incorrect when the nexthop is unchanged, as is commonly the case in route reflection. Adjust the AIGP for propagation only when the nexthop is set to ourselves. Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
Diffstat (limited to 'bgpd/bgp_updgrp_packet.c')
-rw-r--r--bgpd/bgp_updgrp_packet.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c
index bed00a6640..3ce136ef87 100644
--- a/bgpd/bgp_updgrp_packet.c
+++ b/bgpd/bgp_updgrp_packet.c
@@ -738,9 +738,9 @@ struct bpacket *subgroup_update_packet(struct update_subgroup *subgrp)
/* 5: Encode all the attributes, except MP_REACH_NLRI
* attr. */
- total_attr_len = bgp_packet_attribute(
- NULL, peer, s, adv->baa->attr, &vecarr, NULL,
- afi, safi, from, NULL, NULL, 0, 0, 0, path);
+ total_attr_len = bgp_packet_attribute(NULL, peer, s, adv->baa->attr,
+ &vecarr, NULL, afi, safi, from, NULL,
+ NULL, 0, 0, 0);
space_remaining =
STREAM_CONCAT_REMAIN(s, snlri, STREAM_SIZE(s))
@@ -1149,12 +1149,9 @@ void subgroup_default_update_packet(struct update_subgroup *subgrp,
/* Make place for total attribute length. */
pos = stream_get_endp(s);
stream_putw(s, 0);
- total_attr_len =
- bgp_packet_attribute(NULL, peer, s, attr, &vecarr, &p, afi,
- safi, from, NULL, &label, num_labels,
- addpath_capable,
- BGP_ADDPATH_TX_ID_FOR_DEFAULT_ORIGINATE,
- NULL);
+ total_attr_len = bgp_packet_attribute(NULL, peer, s, attr, &vecarr, &p, afi, safi, from,
+ NULL, &label, num_labels, addpath_capable,
+ BGP_ADDPATH_TX_ID_FOR_DEFAULT_ORIGINATE);
/* Set Total Path Attribute Length. */
stream_putw_at(s, pos, total_attr_len);