From 5a8b1fb047d675badc17ab24175d0db06d7cc00c Mon Sep 17 00:00:00 2001 From: Michal 'vorner' Vaner Date: Tue, 5 Sep 2017 15:50:00 +0200 Subject: [PATCH] filter: Allow assigning enums into extended attributes They are internally ints, but they got refused as a wrong type. This fixes setting of the BGP origin and is also needed for RA. --- filter/filter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filter/filter.c b/filter/filter.c index f18970e0..1e8f7d5a 100644 --- a/filter/filter.c +++ b/filter/filter.c @@ -1088,7 +1088,8 @@ interpret(struct f_inst *what) switch (what->aux & EAF_TYPE_MASK) { case EAF_TYPE_INT: - if (v1.type != T_INT) + // Enums are also ints, so allow them in. + if (v1.type != T_INT && (v1.type < T_ENUM_LO || v1.type > T_ENUM_HI)) runtime( "Setting int attribute to non-int value" ); l->attrs[0].u.data = v1.val.i; break;