Merge pull request #7192 from deastoe/zebra-fpm-blackhole-abort

zebra: fix FPM abort for unreach/prohibit routes
This commit is contained in:
Donald Sharp 2020-09-29 13:47:38 -04:00 committed by GitHub
commit dbbae374d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -335,11 +335,19 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd,
} }
} }
if (ri->num_nhs == 0) {
switch (ri->rtm_type) {
case RTN_PROHIBIT:
case RTN_UNREACHABLE:
case RTN_BLACKHOLE:
break;
default:
/* If there is no useful nexthop then return. */ /* If there is no useful nexthop then return. */
if (ri->rtm_type != RTN_BLACKHOLE && ri->num_nhs == 0) { zfpm_debug(
zfpm_debug("netlink_encode_route(): No useful nexthop."); "netlink_encode_route(): No useful nexthop.");
return 0; return 0;
} }
}
return 1; return 1;
} }