Skip to content

Commit f90989d

Browse files
committed
zebra: Allow blackhole singleton nexthops to be v6
A blackhole nexthop, according to the linux kernel, can be v4 or v6. A v4 blackhole nexthop cannot be used on a v6 route, but a v6 blackhole nexthop can be used with a v4 route. Convert all blackhole singleton nexthops to v6 and just use that. Possibly reducing the number of active nexthops by 1. Signed-off-by: Donald Sharp <[email protected]>
1 parent c10cdcd commit f90989d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

zebra/zebra_nhg.c

+11-6
Original file line numberDiff line numberDiff line change
@@ -356,18 +356,23 @@ void zebra_nhe_init(struct nhg_hash_entry *nhe, afi_t afi,
356356
*/
357357
if (nh && (nh->next == NULL)) {
358358
switch (nh->type) {
359-
case NEXTHOP_TYPE_IFINDEX:
360-
case NEXTHOP_TYPE_BLACKHOLE:
361359
/*
362360
* This switch case handles setting the afi different
363-
* for ipv4/v6 routes. Ifindex/blackhole nexthop
361+
* for ipv4/v6 routes. Ifindex nexthop
364362
* objects cannot be ambiguous, they must be Address
365-
* Family specific. If we get here, we will either use
366-
* the AF of the route, or the one we got passed from
367-
* here from the kernel.
363+
* Family specific as that the kernel relies on these
364+
* for some reason. blackholes can be v6 because the
365+
* v4 kernel infrastructure allows the usage of v6
366+
* blackholes in this case. if we get here, we will
367+
* either use the AF of the route, or the one we got
368+
* passed from here from the kernel.
368369
*/
370+
case NEXTHOP_TYPE_IFINDEX:
369371
nhe->afi = afi;
370372
break;
373+
case NEXTHOP_TYPE_BLACKHOLE:
374+
nhe->afi = AFI_IP6;
375+
break;
371376
case NEXTHOP_TYPE_IPV4_IFINDEX:
372377
case NEXTHOP_TYPE_IPV4:
373378
nhe->afi = AFI_IP;

0 commit comments

Comments
 (0)