Commit 5a8b1fb0 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner Committed by Ondřej Zajíček
Browse files

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.
parent cd1d9961
......@@ -1088,7 +1088,8 @@ interpret(struct f_inst *what)
switch (what->aux & EAF_TYPE_MASK) {
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] = v1.val.i;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment