]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Taming static checker: MPLS static label policy requires static handles
authorMaria Matejka <mq@ucw.cz>
Thu, 13 Feb 2025 12:10:04 +0000 (13:10 +0100)
committerMaria Matejka <mq@ucw.cz>
Mon, 10 Mar 2025 10:19:01 +0000 (11:19 +0100)
nest/mpls.c

index b81f82c1f5860a7df98fb6009b31479a0b651efe..5cf7d552e678cdc6f071b0d0ab8ddc3f254ef5c8 100644 (file)
@@ -853,6 +853,10 @@ mpls_fec_map_reconfigure(struct mpls_fec_map *m, struct channel *C)
     if ((fec->handle == m->handle) || (fec->handle == m->static_handle))
       continue;
 
+    /* Consistency check: static policy requires static handle to exist */
+    if (!m->static_handle)
+      ASSERT_DIE(fec->policy != MPLS_POLICY_STATIC);
+
     /* Try new handle for the FEC */
     struct mpls_handle_pub *new_pub = (fec->policy != MPLS_POLICY_STATIC) ? m->handle : m->static_handle;
     struct mpls_handle *new = MPLS_HANDLE_PRIV(new_pub);