From: Donald Sharp Date: Wed, 4 Aug 2021 17:29:48 +0000 (-0400) Subject: lib: Blackhole nexthops cannot be used as part of label generation X-Git-Tag: base_8.1~222^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b7457b40cd77e0f3e6b45a77232af64aba17aea3;p=matthieu%2Ffrr.git lib: Blackhole nexthops cannot be used as part of label generation Signed-off-by: Donald Sharp --- diff --git a/lib/zclient.c b/lib/zclient.c index f68e0e1b0c..5ca5849948 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -3442,6 +3442,14 @@ int zapi_labels_decode(struct stream *s, struct zapi_labels *zl) if (zapi_nexthop_decode(s, znh, 0, 0) < 0) return -1; + + if (znh->type == NEXTHOP_TYPE_BLACKHOLE) { + flog_warn( + EC_LIB_ZAPI_ENCODE, + "%s: Prefix %pFX has a blackhole nexthop which we cannot use for a label", + __func__, &zl->route.prefix); + return -1; + } } if (CHECK_FLAG(zl->message, ZAPI_LABELS_HAS_BACKUPS)) { @@ -3463,6 +3471,14 @@ int zapi_labels_decode(struct stream *s, struct zapi_labels *zl) if (zapi_nexthop_decode(s, znh, 0, 0) < 0) return -1; + + if (znh->type == NEXTHOP_TYPE_BLACKHOLE) { + flog_warn( + EC_LIB_ZAPI_ENCODE, + "%s: Prefix %pFX has a backup blackhole nexthop which we cannot use for a label", + __func__, &zl->route.prefix); + return -1; + } } }