if (ret != RMAP_PERMITMATCH)
continue;
- if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)
- || (addpath_capable
- && bgp_addpath_tx_path(
- peer->addpath_type[afi][safi],
- pi))) {
-
+ if (bgp_check_selected(pi, peer, addpath_capable, afi,
+ safi)) {
/* Skip route-map checks in
* subgroup_announce_check while executing from
* the conditional advertise scanner process.
#include "bgpd/bgp_debug.h"
#include "bgpd/bgp_errors.h"
#include "bgpd/bgp_fsm.h"
+#include "bgpd/bgp_addpath.h"
#include "bgpd/bgp_advertise.h"
#include "bgpd/bgp_packet.h"
#include "bgpd/bgp_updgrp.h"
&& CHECK_FLAG(peer->af_cap[afi][safi],
PEER_CAP_ADDPATH_AF_RX_RCV));
}
+
+bool bgp_check_selected(struct bgp_path_info *bpi, struct peer *peer,
+ bool addpath_capable, afi_t afi, safi_t safi)
+{
+ return (CHECK_FLAG(bpi->flags, BGP_PATH_SELECTED) ||
+ (addpath_capable &&
+ bgp_addpath_tx_path(peer->addpath_type[afi][safi], bpi)));
+}
extern void update_bgp_group_free(struct bgp *bgp);
extern bool bgp_addpath_encode_tx(struct peer *peer, afi_t afi, safi_t safi);
+extern bool bgp_check_selected(struct bgp_path_info *bpi, struct peer *peer,
+ bool addpath_capable, afi_t afi, safi_t safi);
/*
* Inline functions
for (ri = bgp_dest_get_bgp_path_info(dest); ri; ri = ri->next)
- if (CHECK_FLAG(ri->flags, BGP_PATH_SELECTED)
- || (addpath_capable
- && bgp_addpath_tx_path(
- peer->addpath_type[afi][safi],
- ri))) {
+ if (bgp_check_selected(ri, peer, addpath_capable, afi,
+ safi)) {
if (subgroup_announce_check(dest, ri, subgrp,
dest_p, &attr,
false)) {