summaryrefslogtreecommitdiff
path: root/bgpd/bgp_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_zebra.c')
-rw-r--r--bgpd/bgp_zebra.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 4d18078a43..72620de7d9 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -1331,10 +1331,7 @@ static void bgp_zebra_announce_parse_nexthop(
&nh_weight))
continue;
}
- if (CHECK_FLAG(info->flags, BGP_PATH_SELECTED))
- api_nh = &api->nexthops[*valid_nh_count];
- else
- api_nh = &api->backup_nexthops[*valid_nh_count];
+ api_nh = &api->nexthops[*valid_nh_count];
api_nh->srte_color = bgp_attr_get_color(info->attr);
@@ -1559,7 +1556,6 @@ bgp_zebra_announce_actual(struct bgp_dest *dest, struct bgp_path_info *info,
struct peer *peer;
uint32_t metric;
route_tag_t tag;
- bool is_add;
uint32_t nhg_id = 0;
struct bgp_table *table = bgp_dest_table(dest);
const struct prefix *p = bgp_dest_get_prefix(dest);
@@ -1613,9 +1609,7 @@ bgp_zebra_announce_actual(struct bgp_dest *dest, struct bgp_path_info *info,
table->afi, table->safi, &nhg_id,
&metric, &tag, &allow_recursion);
- is_add = (valid_nh_count || nhg_id) ? true : false;
-
- if (is_add && CHECK_FLAG(bm->flags, BM_FLAG_SEND_EXTRA_DATA_TO_ZEBRA)) {
+ if (CHECK_FLAG(bm->flags, BM_FLAG_SEND_EXTRA_DATA_TO_ZEBRA)) {
struct bgp_zebra_opaque bzo = {};
const char *reason =
bgp_path_selection_reason2str(dest->reason);
@@ -1671,18 +1665,17 @@ bgp_zebra_announce_actual(struct bgp_dest *dest, struct bgp_path_info *info,
}
if (bgp_debug_zebra(p)) {
- zlog_debug("Tx route %s %s %pFX metric %u tag %" ROUTE_TAG_PRI
+ zlog_debug("Tx route add %s (table id %u) %pFX metric %u tag %" ROUTE_TAG_PRI
" count %d nhg %d",
- is_add ? "add" : "delete", bgp->name_pretty,
- &api.prefix, api.metric, api.tag, api.nexthop_num,
- nhg_id);
+ bgp->name_pretty, api.tableid, &api.prefix,
+ api.metric, api.tag, api.nexthop_num, nhg_id);
bgp_debug_zebra_nh(&api);
zlog_debug("%s: %pFX: announcing to zebra (recursion %sset)",
__func__, p, (allow_recursion ? "" : "NOT "));
}
- return zclient_route_send(is_add ? ZEBRA_ROUTE_ADD : ZEBRA_ROUTE_DELETE,
- zclient, &api);
+
+ return zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api);
}
@@ -1764,8 +1757,8 @@ enum zclient_send_status bgp_zebra_withdraw_actual(struct bgp_dest *dest,
}
if (bgp_debug_zebra(p))
- zlog_debug("Tx route delete %s %pFX", bgp->name_pretty,
- &api.prefix);
+ zlog_debug("Tx route delete %s (table id %u) %pFX",
+ bgp->name_pretty, api.tableid, &api.prefix);
return zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api);
}
@@ -1794,6 +1787,8 @@ static void bgp_handle_route_announcements_to_zebra(struct event *e)
bool install;
while (count < ZEBRA_ANNOUNCEMENTS_LIMIT) {
+ is_evpn = false;
+
dest = zebra_announce_pop(&bm->zebra_announce_head);
if (!dest)
@@ -3980,6 +3975,11 @@ int bgp_zebra_send_capabilities(struct bgp *bgp, bool disable)
return BGP_GR_FAILURE;
}
+ if (BGP_DEBUG(zebra, ZEBRA))
+ zlog_debug("%s(%d): Sending GR capability %s to zebra",
+ bgp->name_pretty, bgp->vrf_id,
+ disable ? "disabled" : "enabled");
+
/* Check if capability is already sent. If the flag force is set
* send the capability since this can be initial bgp configuration
*/
@@ -3995,8 +3995,8 @@ int bgp_zebra_send_capabilities(struct bgp *bgp, bool disable)
if (zclient_capabilities_send(ZEBRA_CLIENT_CAPABILITIES, zclient, &api)
== ZCLIENT_SEND_FAILURE) {
- zlog_err("%s: %s error sending capability", __func__,
- bgp->name_pretty);
+ zlog_err("%s(%d): Error sending GR capability to zebra",
+ bgp->name_pretty, bgp->vrf_id);
ret = BGP_GR_FAILURE;
} else {
if (disable)
@@ -4004,9 +4004,6 @@ int bgp_zebra_send_capabilities(struct bgp *bgp, bool disable)
else
bgp->present_zebra_gr_state = ZEBRA_GR_ENABLE;
- if (BGP_DEBUG(zebra, ZEBRA))
- zlog_debug("%s: %s send capabilty success", __func__,
- bgp->name_pretty);
ret = BGP_GR_SUCCESS;
}
return ret;