From: Maria Matejka Date: Sun, 28 Jan 2024 22:37:08 +0000 (+0100) Subject: Hack-fix of IPv6 SADR literal parsing X-Git-Tag: v3.0.0~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e5cf618ef823db4e414bd7960265d84479bf718;p=thirdparty%2Fbird.git Hack-fix of IPv6 SADR literal parsing This should be probably once done better, not by ad-hoc disabling the attribute symbol table when parsing SADR literals. --- diff --git a/conf/cf-lex.l b/conf/cf-lex.l index 725820833..b7ecfb7bf 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -893,8 +893,15 @@ cf_swap_soft_scope(struct config *conf) void cf_enter_filters(void) { - ASSERT_DIE(!new_config->allow_attributes); + ASSERT_DIE(!cf_maybe_enter_filters()); +} + +int +cf_maybe_enter_filters(void) +{ + int o = new_config->allow_attributes; new_config->allow_attributes = 1; + return o; } /** @@ -903,8 +910,15 @@ cf_enter_filters(void) void cf_exit_filters(void) { - ASSERT_DIE(new_config->allow_attributes); + ASSERT_DIE(cf_maybe_exit_filters()); +} + +int +cf_maybe_exit_filters(void) +{ + int o = new_config->allow_attributes; new_config->allow_attributes = 0; + return o; } diff --git a/conf/conf.h b/conf/conf.h index f6e9069dd..ea4aac35e 100644 --- a/conf/conf.h +++ b/conf/conf.h @@ -159,6 +159,8 @@ struct sym_scope { void cf_enter_filters(void); void cf_exit_filters(void); +int cf_maybe_enter_filters(void); +int cf_maybe_exit_filters(void); extern pool *global_root_scope_pool; extern linpool *global_root_scope_linpool; diff --git a/conf/confbase.Y b/conf/confbase.Y index 9324c5594..845070b28 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -28,6 +28,8 @@ CF_HDR CF_DEFINES +static _Bool this_sadr_from_hack_active; + static void check_u16(uint val) { @@ -119,7 +121,7 @@ CF_DECLS %type expr bool pxlen4 %type