From: Maria Matejka Date: Thu, 13 Feb 2025 12:10:04 +0000 (+0100) Subject: Taming static checker: MPLS static label policy requires static handles X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b9568a6ab1274207c3889347b252ca1d15b8a16;p=thirdparty%2Fbird.git Taming static checker: MPLS static label policy requires static handles --- diff --git a/nest/mpls.c b/nest/mpls.c index b81f82c1f..5cf7d552e 100644 --- a/nest/mpls.c +++ b/nest/mpls.c @@ -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);