Skip to content

Commit 6cdc82b

Browse files
committed
zebra: fix showing nexthop vrf for ipv6 blackhole
For some reasons the Linux kernel associates the ipv6 blackhole of non default table the lo interface. > root@r1# ip -6 route show table 100 > root@r1# ip -6 route add unreachable default metric 4278198272 table 100 > root@r1# ip -6 route show table 100 > unreachable default dev lo metric 4278198272 pref medium As a consequence, the VRF default that owns the lo interface is shown as the nexthop VRF: > r1# show ipv6 route table 20 > Table 20: > K>* ::/0 [255/8192] unreachable (ICMP unreachable) (vrf default), 00:18:12 Do not display the nexthop VRF of a blackhole. It does not make sense for a blackhole and it was not displayed in the past. Signed-off-by: Louis Scalbert <[email protected]>
1 parent 3f69054 commit 6cdc82b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

zebra/zebra_rnh.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ void show_nexthop_json_helper(json_object *json_nexthop,
12711271
bool display_vrfid = false;
12721272
uint8_t rn_family;
12731273

1274-
if (re == NULL || nexthop->vrf_id != re->vrf_id)
1274+
if ((re == NULL || nexthop->vrf_id != re->vrf_id) && nexthop->type != NEXTHOP_TYPE_BLACKHOLE)
12751275
display_vrfid = true;
12761276

12771277
if (rn)
@@ -1292,7 +1292,7 @@ void show_route_nexthop_helper(struct vty *vty, const struct route_node *rn,
12921292
bool display_vrfid = false;
12931293
uint8_t rn_family;
12941294

1295-
if (re == NULL || nexthop->vrf_id != re->vrf_id)
1295+
if ((re == NULL || nexthop->vrf_id != re->vrf_id) && nexthop->type != NEXTHOP_TYPE_BLACKHOLE)
12961296
display_vrfid = true;
12971297

12981298
if (rn)

zebra/zebra_vty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ static void show_nexthop_detail_helper(struct vty *vty,
370370
break;
371371
}
372372

373-
if (re->vrf_id != nexthop->vrf_id) {
373+
if (re->vrf_id != nexthop->vrf_id && nexthop->type != NEXTHOP_TYPE_BLACKHOLE) {
374374
struct vrf *vrf = vrf_lookup_by_id(nexthop->vrf_id);
375375

376376
vty_out(vty, "(vrf %s)", VRF_LOGNAME(vrf));

0 commit comments

Comments
 (0)