/* If we are not shutting down ourselves and we are
* aggregating a route that contains the GSHUT community we
* need to remove that community when creating the aggregate */
- if (!CHECK_FLAG(bgp->flags, BGP_FLAG_GRACEFUL_SHUTDOWN)
+ if (!bgp_in_graceful_shutdown(bgp)
&& community_include(community, gshut)) {
community_del_val(community, &gshut);
}
attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
}
- if (CHECK_FLAG(bgp->flags, BGP_FLAG_GRACEFUL_SHUTDOWN))
+ if (bgp_in_graceful_shutdown(bgp))
bgp_attr_add_gshut_community(&attr);
attr.label_index = BGP_INVALID_LABEL_INDEX;
return NULL;
}
- if (CHECK_FLAG(bgp->flags, BGP_FLAG_GRACEFUL_SHUTDOWN))
+ if (bgp_in_graceful_shutdown(bgp))
bgp_attr_add_gshut_community(&attr_tmp);
new = bgp_attr_intern(&attr_tmp);
} else {
- if (CHECK_FLAG(bgp->flags, BGP_FLAG_GRACEFUL_SHUTDOWN))
+ if (bgp_in_graceful_shutdown(bgp))
bgp_attr_add_gshut_community(&attr);
new = bgp_attr_intern(&attr);
if (aspath_check_as_zero(attr->aspath))
return false;
- if (CHECK_FLAG(bgp->flags, BGP_FLAG_GRACEFUL_SHUTDOWN)) {
+ if (bgp_in_graceful_shutdown(bgp)) {
if (peer->sort == BGP_PEER_IBGP
|| peer->sort == BGP_PEER_CONFED) {
attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF);
/* If graceful-shutdown is configured then add the GSHUT
* community to all paths received from eBGP peers */
- } else if (CHECK_FLAG(peer->bgp->flags,
- BGP_FLAG_GRACEFUL_SHUTDOWN))
+ } else if (bgp_in_graceful_shutdown(peer->bgp))
bgp_attr_add_gshut_community(&new_attr);
}
return;
}
- if (CHECK_FLAG(bgp->flags, BGP_FLAG_GRACEFUL_SHUTDOWN))
+ if (bgp_in_graceful_shutdown(bgp))
bgp_attr_add_gshut_community(&attr_tmp);
attr_new = bgp_attr_intern(&attr_tmp);
} else {
- if (CHECK_FLAG(bgp->flags, BGP_FLAG_GRACEFUL_SHUTDOWN))
+ if (bgp_in_graceful_shutdown(bgp))
bgp_attr_add_gshut_community(&attr);
attr_new = bgp_attr_intern(&attr);
}
}
- if (CHECK_FLAG(bgp->flags, BGP_FLAG_GRACEFUL_SHUTDOWN))
+ if (bgp_in_graceful_shutdown(bgp))
bgp_attr_add_gshut_community(&attr_new);
bn = bgp_afi_node_get(bgp->rib[afi][SAFI_UNICAST], afi,
}
/* Advertise the default route */
- if (CHECK_FLAG(bgp->flags, BGP_FLAG_GRACEFUL_SHUTDOWN))
+ if (bgp_in_graceful_shutdown(bgp))
bgp_attr_add_gshut_community(new_attr);
SET_FLAG(subgrp->sflags,
bgp->vrf_id = VRF_UNKNOWN;
}
+static inline bool bgp_in_graceful_shutdown(struct bgp *bgp)
+{
+ return !!CHECK_FLAG(bgp->flags, BGP_FLAG_GRACEFUL_SHUTDOWN);
+}
+
extern void bgp_unset_redist_vrf_bitmaps(struct bgp *, vrf_id_t);
/* For benefit of rfapi */