zebra: reject proto NHGs of blackhole/interface

Reject proto NHGs of type blackhole/interface for now.
We need to think a bit more about how to resolve these
given the linux kernel needs to know the Address Family
of the routes that will use them and install it with them.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
Stephen Worley 2020-08-03 14:34:52 -04:00
parent 73937edb73
commit 70f3cda6c1

View File

@ -2759,10 +2759,26 @@ struct nhg_hash_entry *zebra_nhg_proto_add(uint32_t id, int type,
* Once resolution is figured out, we won't need this!
*/
for (ALL_NEXTHOPS_PTR(nhg, newhop)) {
if (newhop->type == NEXTHOP_TYPE_BLACKHOLE) {
if (IS_ZEBRA_DEBUG_NHG)
zlog_debug(
"%s: id %u, blackhole nexthop not supported",
__func__, id);
return NULL;
}
if (newhop->type == NEXTHOP_TYPE_IFINDEX) {
if (IS_ZEBRA_DEBUG_NHG)
zlog_debug(
"%s: id %u, nexthop without gateway not supported",
__func__, id);
return NULL;
}
if (!newhop->ifindex) {
if (IS_ZEBRA_DEBUG_NHG)
zlog_debug(
"%s: id %u, nexthop without ifindex passed to add",
"%s: id %u, nexthop without ifindex is not supported",
__func__, id);
return NULL;
}