mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-26 00:00:50 +00:00
Merge pull request #15636 from pguibert6WIND/resolved_prefix_bgp
bgpd: add resolved_prefix visibility on nht
This commit is contained in:
commit
c7fde7a32e
@ -1003,6 +1003,8 @@ static void bgp_show_nexthop(struct vty *vty, struct bgp *bgp,
|
|||||||
if (bnc->is_evpn_gwip_nexthop)
|
if (bnc->is_evpn_gwip_nexthop)
|
||||||
json_object_boolean_true_add(json_nexthop,
|
json_object_boolean_true_add(json_nexthop,
|
||||||
"isEvpnGatewayIp");
|
"isEvpnGatewayIp");
|
||||||
|
json_object_string_addf(json, "resolvedPrefix", "%pFX",
|
||||||
|
&bnc->resolved_prefix);
|
||||||
} else {
|
} else {
|
||||||
vty_out(vty, " %s valid [IGP metric %d], #paths %d",
|
vty_out(vty, " %s valid [IGP metric %d], #paths %d",
|
||||||
buf, bnc->metric, bnc->path_count);
|
buf, bnc->metric, bnc->path_count);
|
||||||
@ -1010,6 +1012,8 @@ static void bgp_show_nexthop(struct vty *vty, struct bgp *bgp,
|
|||||||
vty_out(vty, ", peer %s", peer->host);
|
vty_out(vty, ", peer %s", peer->host);
|
||||||
if (bnc->is_evpn_gwip_nexthop)
|
if (bnc->is_evpn_gwip_nexthop)
|
||||||
vty_out(vty, " EVPN Gateway IP");
|
vty_out(vty, " EVPN Gateway IP");
|
||||||
|
vty_out(vty, "\n Resolved prefix %pFX",
|
||||||
|
&bnc->resolved_prefix);
|
||||||
vty_out(vty, "\n");
|
vty_out(vty, "\n");
|
||||||
}
|
}
|
||||||
bgp_show_nexthops_detail(vty, bgp, bnc, json_nexthop);
|
bgp_show_nexthops_detail(vty, bgp, bnc, json_nexthop);
|
||||||
|
@ -90,6 +90,7 @@ struct bgp_nexthop_cache {
|
|||||||
struct bgp_nexthop_cache_head *tree;
|
struct bgp_nexthop_cache_head *tree;
|
||||||
|
|
||||||
struct prefix prefix;
|
struct prefix prefix;
|
||||||
|
struct prefix resolved_prefix;
|
||||||
void *nht_info; /* In BGP, peer session */
|
void *nht_info; /* In BGP, peer session */
|
||||||
LIST_HEAD(path_list, bgp_path_info) paths;
|
LIST_HEAD(path_list, bgp_path_info) paths;
|
||||||
unsigned int path_count;
|
unsigned int path_count;
|
||||||
|
@ -626,6 +626,8 @@ static void bgp_process_nexthop_update(struct bgp_nexthop_cache *bnc,
|
|||||||
} else if (nhr->nexthop_num) {
|
} else if (nhr->nexthop_num) {
|
||||||
struct peer *peer = bnc->nht_info;
|
struct peer *peer = bnc->nht_info;
|
||||||
|
|
||||||
|
prefix_copy(&bnc->resolved_prefix, &nhr->prefix);
|
||||||
|
|
||||||
/* notify bgp fsm if nbr ip goes from invalid->valid */
|
/* notify bgp fsm if nbr ip goes from invalid->valid */
|
||||||
if (!bnc->nexthop_num)
|
if (!bnc->nexthop_num)
|
||||||
UNSET_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED);
|
UNSET_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED);
|
||||||
@ -731,6 +733,7 @@ static void bgp_process_nexthop_update(struct bgp_nexthop_cache *bnc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
memset(&bnc->resolved_prefix, 0, sizeof(bnc->resolved_prefix));
|
||||||
bnc->flags &= ~BGP_NEXTHOP_EVPN_INCOMPLETE;
|
bnc->flags &= ~BGP_NEXTHOP_EVPN_INCOMPLETE;
|
||||||
bnc->flags &= ~BGP_NEXTHOP_VALID;
|
bnc->flags &= ~BGP_NEXTHOP_VALID;
|
||||||
bnc->flags &= ~BGP_NEXTHOP_LABELED_VALID;
|
bnc->flags &= ~BGP_NEXTHOP_LABELED_VALID;
|
||||||
|
Loading…
Reference in New Issue
Block a user