summaryrefslogtreecommitdiffstats
path: root/src/datatype.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2013-09-04 13:13:35 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2013-09-04 13:15:42 +0200
commit78c4b630124ee09dff17026b3e2cd5820942093b (patch)
treebb5989c9a2b40a8d9aa366067964da7792f02a1f /src/datatype.c
parent67f4f35cb2df1d21878978d414e108a0fc9e8d73 (diff)
datatype: fix mark parsing if string is used
This fixes string mark parsing. Note that /etc/iproute2/rt_marks may contain mapping between string and mark values. This fixes here: add rule filter output meta mark 0 counter Assumming that: cat /etc/iproute2/rt_marks says: 0 test Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/datatype.c')
-rw-r--r--src/datatype.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/datatype.c b/src/datatype.c
index 12e876cf..c4fc131d 100644
--- a/src/datatype.c
+++ b/src/datatype.c
@@ -632,6 +632,17 @@ static struct error_record *mark_type_parse(const struct expr *sym,
struct expr **res)
{
struct error_record *erec;
+ const struct symbolic_constant *s;
+
+ for (s = mark_tbl->symbols; s->identifier != NULL; s++) {
+ if (!strcmp(sym->identifier, s->identifier)) {
+ *res = constant_expr_alloc(&sym->location, sym->dtype,
+ sym->dtype->byteorder,
+ sym->dtype->size,
+ &s->value);
+ return NULL;
+ }
+ }
erec = sym->dtype->basetype->parse(sym, res);
if (erec != NULL)