mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 04:47:05 +00:00
Merge pull request #16689 from donaldsharp/blackhole_and_afi
Blackhole and afi
This commit is contained in:
commit
90787a57fd
@ -356,18 +356,23 @@ void zebra_nhe_init(struct nhg_hash_entry *nhe, afi_t afi,
|
|||||||
*/
|
*/
|
||||||
if (nh && (nh->next == NULL)) {
|
if (nh && (nh->next == NULL)) {
|
||||||
switch (nh->type) {
|
switch (nh->type) {
|
||||||
case NEXTHOP_TYPE_IFINDEX:
|
|
||||||
case NEXTHOP_TYPE_BLACKHOLE:
|
|
||||||
/*
|
/*
|
||||||
* This switch case handles setting the afi different
|
* This switch case handles setting the afi different
|
||||||
* for ipv4/v6 routes. Ifindex/blackhole nexthop
|
* for ipv4/v6 routes. Ifindex nexthop
|
||||||
* objects cannot be ambiguous, they must be Address
|
* objects cannot be ambiguous, they must be Address
|
||||||
* Family specific. If we get here, we will either use
|
* Family specific as that the kernel relies on these
|
||||||
* the AF of the route, or the one we got passed from
|
* for some reason. blackholes can be v6 because the
|
||||||
* here from the kernel.
|
* v4 kernel infrastructure allows the usage of v6
|
||||||
|
* blackholes in this case. if we get here, we will
|
||||||
|
* either use the AF of the route, or the one we got
|
||||||
|
* passed from here from the kernel.
|
||||||
*/
|
*/
|
||||||
|
case NEXTHOP_TYPE_IFINDEX:
|
||||||
nhe->afi = afi;
|
nhe->afi = afi;
|
||||||
break;
|
break;
|
||||||
|
case NEXTHOP_TYPE_BLACKHOLE:
|
||||||
|
nhe->afi = AFI_IP6;
|
||||||
|
break;
|
||||||
case NEXTHOP_TYPE_IPV4_IFINDEX:
|
case NEXTHOP_TYPE_IPV4_IFINDEX:
|
||||||
case NEXTHOP_TYPE_IPV4:
|
case NEXTHOP_TYPE_IPV4:
|
||||||
nhe->afi = AFI_IP;
|
nhe->afi = AFI_IP;
|
||||||
|
@ -1195,6 +1195,7 @@ static void show_nexthop_group_out(struct vty *vty, struct nhg_hash_entry *nhe,
|
|||||||
json_object_string_add(json, "uptime", up_str);
|
json_object_string_add(json, "uptime", up_str);
|
||||||
json_object_string_add(json, "vrf",
|
json_object_string_add(json, "vrf",
|
||||||
vrf_id_to_name(nhe->vrf_id));
|
vrf_id_to_name(nhe->vrf_id));
|
||||||
|
json_object_string_add(json, "afi", afi2str(nhe->afi));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
vty_out(vty, "ID: %u (%s)\n", nhe->id,
|
vty_out(vty, "ID: %u (%s)\n", nhe->id,
|
||||||
@ -1208,7 +1209,8 @@ static void show_nexthop_group_out(struct vty *vty, struct nhg_hash_entry *nhe,
|
|||||||
vty_out(vty, "\n");
|
vty_out(vty, "\n");
|
||||||
|
|
||||||
vty_out(vty, " Uptime: %s\n", up_str);
|
vty_out(vty, " Uptime: %s\n", up_str);
|
||||||
vty_out(vty, " VRF: %s\n", vrf_id_to_name(nhe->vrf_id));
|
vty_out(vty, " VRF: %s(%s)\n", vrf_id_to_name(nhe->vrf_id),
|
||||||
|
afi2str(nhe->afi));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_VALID)) {
|
if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_VALID)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user