From 84cf34938294e404fd7e9ebe1a630fe868ae22da Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Mon, 15 Apr 2013 00:36:36 +0200 Subject: expr: fix concat expression type propagation Dynamically instantiate a data type to represent all types of a concatenation and use that for type propagation. --- include/datatype.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/datatype.h') diff --git a/include/datatype.h b/include/datatype.h index 53889934..8a123631 100644 --- a/include/datatype.h +++ b/include/datatype.h @@ -117,6 +117,12 @@ extern struct error_record *symbol_parse(const struct expr *sym, struct expr **res); extern void datatype_print(const struct expr *expr); +static inline bool datatype_equal(const struct datatype *d1, + const struct datatype *d2) +{ + return d1->type == d2->type; +} + /** * struct symbolic_constant - symbol <-> constant mapping * @@ -168,4 +174,7 @@ extern const struct datatype inet_service_type; extern const struct datatype mark_type; extern const struct datatype time_type; +extern const struct datatype *concat_type_alloc(const struct expr *expr); +extern void concat_type_destroy(const struct datatype *dtype); + #endif /* NFTABLES_DATATYPE_H */ -- cgit v1.2.3