diff options
author | Michal 'vorner' Vaner <michal.vaner@nic.cz> | 2017-09-05 15:50:00 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-09-20 15:36:54 +0200 |
commit | 5a8b1fb047d675badc17ab24175d0db06d7cc00c (patch) | |
tree | 7360a432d8310bd5d7142125105c241457a3adc2 /filter | |
parent | cd1d99611e445c9fe2452d05627ccfc624f35c39 (diff) |
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.
Diffstat (limited to 'filter')
-rw-r--r-- | filter/filter.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |