diff options
author | Pavel Machek <pavel@ucw.cz> | 2000-04-17 16:12:02 +0200 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2000-04-17 16:12:02 +0200 |
commit | 0150e5211adabcbde55a76506f0f1a5901214b52 (patch) | |
tree | c80ed39d0f9fb40871645824b617a2fcdfc1dd4c | |
parent | 74a7da482b1a537aaa97b4b5d6f6815887150f26 (diff) | |
download | bird-0150e5211adabcbde55a76506f0f1a5901214b52.tar bird-0150e5211adabcbde55a76506f0f1a5901214b52.zip |
Cleaned up mess with types in e,a and e,S. Dynamic attributes should
now work.
-rw-r--r-- | filter/f-util.c | 2 | ||||
-rw-r--r-- | filter/filter.c | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/filter/f-util.c b/filter/f-util.c index 2ffcd9f..cf174e7 100644 --- a/filter/f-util.c +++ b/filter/f-util.c @@ -24,7 +24,7 @@ struct f_inst * f_new_dynamic_attr(int type, int f_type, int code) { struct f_inst *f = f_new_inst(); - f->aux = f_type; + f->aux = type; f->a2.i = code; return f; } diff --git a/filter/filter.c b/filter/filter.c index fd6ea35..172e77b 100644 --- a/filter/filter.c +++ b/filter/filter.c @@ -353,13 +353,17 @@ interpret(struct f_inst *what) res.type = T_VOID; break; } - res.type = what->aux; /* FIXME: should check type? */ - switch (what->aux) { - case T_INT: + switch (what->aux & EAF_TYPE_MASK) { + case EAF_TYPE_INT: + res.type = T_INT; res.val.i = e->u.data; break; - case T_CLIST: - case T_PATH: + case EAF_TYPE_AS_PATH: + res.type = T_PATH; + res.val.ad = e->u.ptr; + break; + case EAF_TYPE_INT_SET: + res.type = T_CLIST; res.val.ad = e->u.ptr; break; default: @@ -369,9 +373,6 @@ interpret(struct f_inst *what) break; case P('e','S'): ONEARG; - if (v1.type != what->aux) - runtime("Wrong type when setting dynamic attribute"); - { struct ea_list *l = lp_alloc(f_pool, sizeof(struct ea_list) + sizeof(eattr)); @@ -402,6 +403,7 @@ interpret(struct f_inst *what) runtime( "Setting void attribute to non-void value" ); l->attrs[0].u.data = 0; break; + default: bug("Unknown type in e,S"); } if (!(what->aux & EAF_TEMP) && (!(f_flags & FF_FORCE_TMPATTR))) { |