*/
if (nh && (nh->next == NULL)) {
switch (nh->type) {
- case NEXTHOP_TYPE_IFINDEX:
- case NEXTHOP_TYPE_BLACKHOLE:
/*
* 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
- * Family specific. If we get here, we will either use
- * the AF of the route, or the one we got passed from
- * here from the kernel.
+ * Family specific as that the kernel relies on these
+ * for some reason. blackholes can be v6 because the
+ * 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;
break;
+ case NEXTHOP_TYPE_BLACKHOLE:
+ nhe->afi = AFI_IP6;
+ break;
case NEXTHOP_TYPE_IPV4_IFINDEX:
case NEXTHOP_TYPE_IPV4:
nhe->afi = AFI_IP;