From b848ff5de4e974dd9e471fc0888ea990a86e34af Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 28 Nov 2014 21:20:59 +0100 Subject: datatype: relax datatype check in integer_type_parse() Otherwise parsing with basetypes doesn't work. Now nft displays an error when the symbolic constant is not correct: :1:29-31: Error: Could not parse conntrack state add rule test test ct state xxx accept ^^^ Use .sym_tbl instead and default on the symbol_constant_parse() function from the ethertype and pkttype, this simplifies the code and (more importantly) it avoids a breakage after the change in integer_type_parse(). Signed-off-by: Pablo Neira Ayuso --- src/datatype.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/datatype.c') diff --git a/src/datatype.c b/src/datatype.c index 7c9c3d48..1ace3fa7 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -280,8 +280,6 @@ static struct error_record *integer_type_parse(const struct expr *sym, if (gmp_sscanf(sym->identifier, "%Zu%n", v, &len) != 1 || (int)strlen(sym->identifier) != len) { mpz_clear(v); - if (sym->dtype != &integer_type) - return NULL; return error(&sym->location, "Could not parse %s", sym->dtype->desc); } -- cgit v1.2.3