diff options
author | Maria Matejka <mq@ucw.cz> | 2019-07-15 15:17:04 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2019-07-15 15:17:04 +0200 |
commit | f634adc7dcf8cfc2a8ea8a61fe2f85d8aadf5a75 (patch) | |
tree | 952a2d141351126092686bd2fb763edc80a7155d /filter | |
parent | c0999a149c223fa9c622552a314c767e6a640bf6 (diff) |
Filter: FID_MEMBER debug string is a C constant string
Diffstat (limited to 'filter')
-rw-r--r-- | filter/decl.m4 | 6 | ||||
-rw-r--r-- | filter/f-inst.c | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/filter/decl.m4 b/filter/decl.m4 index d8bbf2bc..4d5b70dc 100644 --- a/filter/decl.m4 +++ b/filter/decl.m4 @@ -87,7 +87,7 @@ if ($3) return 0; ]]) m4_ifelse($4,,,[[ FID_DUMP_BODY()m4_dnl -debug("%s$4\n", INDENT, $5); +debug("%s" $4 "\n", INDENT, $5); ]]) FID_INTERPRET_EXEC()m4_dnl const $1 $2 = whati->$2 @@ -208,8 +208,8 @@ m4_define(RESULT_VAL, `FID_HIC(, [[do { res = $1; fstk->vcnt++; } while (0)]], m4_define(RESULT_VOID, `RESULT_VAL([[ (struct f_val) { .type = T_VOID } ]])') # Some common filter instruction members -m4_define(SYMBOL, `FID_MEMBER(struct symbol *, sym, [[strcmp(f1->sym->name, f2->sym->name) || (f1->sym->class != f2->sym->class)]], symbol %s, item->sym->name)') -m4_define(RTC, `FID_MEMBER(struct rtable_config *, rtc, [[strcmp(f1->rtc->name, f2->rtc->name)]], route table %s, item->rtc->name)') +m4_define(SYMBOL, `FID_MEMBER(struct symbol *, sym, [[strcmp(f1->sym->name, f2->sym->name) || (f1->sym->class != f2->sym->class)]], "symbol %s", item->sym->name)') +m4_define(RTC, `FID_MEMBER(struct rtable_config *, rtc, [[strcmp(f1->rtc->name, f2->rtc->name)]], "route table %s", item->rtc->name)') m4_define(STATIC_ATTR, `FID_MEMBER(struct f_static_attr, sa, f1->sa.sa_code != f2->sa.sa_code,,)') m4_define(DYNAMIC_ATTR, `FID_MEMBER(struct f_dynamic_attr, da, f1->da.ea_code != f2->da.ea_code,,)') m4_define(ACCESS_RTE, `FID_HIC(,[[do { if (!fs->rte) runtime("No route to access"); } while (0)]],NEVER_CONSTANT())') diff --git a/filter/f-inst.c b/filter/f-inst.c index f1304833..997bc6ac 100644 --- a/filter/f-inst.c +++ b/filter/f-inst.c @@ -253,7 +253,7 @@ ARG_ANY(1); ARG(2, T_INT); - FID_MEMBER(enum ec_subtype, ecs, f1->ecs != f2->ecs, ec subtype %s, ec_subtype_str(item->ecs)); + FID_MEMBER(enum ec_subtype, ecs, f1->ecs != f2->ecs, "ec subtype %s", ec_subtype_str(item->ecs)); int check, ipv4_used; u32 key, val; @@ -431,7 +431,7 @@ struct f_val, val, [[ !val_same(&(f1->val), &(f2->val)) ]], - value %s, + "value %s", val_dump(&(item->val)) ); @@ -457,7 +457,7 @@ INST(FI_DIE, 0, 0) { NEVER_CONSTANT; - FID_MEMBER(enum filter_return, fret, f1->fret != f2->fret, %s, filter_return_str(item->fret)); + FID_MEMBER(enum filter_return, fret, f1->fret != f2->fret, "%s", filter_return_str(item->fret)); if (fs->buf.start < fs->buf.pos) log_commit(*L_INFO, &fs->buf); @@ -909,7 +909,7 @@ INST(FI_SWITCH, 1, 0) { ARG_ANY(1); - FID_MEMBER(struct f_tree *, tree, [[!same_tree(f1->tree, f2->tree)]], tree %p, item->tree); + FID_MEMBER(struct f_tree *, tree, [[!same_tree(f1->tree, f2->tree)]], "tree %p", item->tree); const struct f_tree *t = find_tree(tree, &v1); if (!t) { @@ -1161,7 +1161,7 @@ NEVER_CONSTANT; ARG(1, T_BOOL); - FID_MEMBER(char *, s, [[strcmp(f1->s, f2->s)]], string %s, item->s); + FID_MEMBER(char *, s, [[strcmp(f1->s, f2->s)]], "string %s", item->s); ASSERT(s); |