]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Blackhole nexthops cannot be used as part of label generation
authorDonald Sharp <sharpd@nvidia.com>
Wed, 4 Aug 2021 17:29:48 +0000 (13:29 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 4 Aug 2021 17:34:03 +0000 (13:34 -0400)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
lib/zclient.c

index f68e0e1b0c17a5aae93bcfe9f9649ded29cd9343..5ca5849948cda3b507d044fe463dcdeb211d5d5f 100644 (file)
@@ -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;
+                       }
                }
        }