diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-09-19 18:15:17 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-11-03 12:23:37 +0100 |
commit | e7361e9b7bc1b583692ea572a133d1c6e942b83f (patch) | |
tree | 73aaac27fb13410490c8177c2380499199db26e7 | |
parent | 6ec23b38a39ff04604b55653d07637853a3ec176 (diff) |
datatype: initialize TYPE_CT_EVENTBIT slot in datatype array
commit 2d9e23a9e9c3c729784a3add41639cbd3f72d504 upstream.
Matching on ct event makes no sense since this is mostly used as
statement to globally filter out ctnetlink events, but do not crash
if it is used from concatenations.
Add the missing slot in the datatype array so this does not crash.
Fixes: 2595b9ad6840 ("ct: add conntrack event mask support")
Reported-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | include/ct.h | 1 | ||||
-rw-r--r-- | src/ct.c | 2 | ||||
-rw-r--r-- | src/datatype.c | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/include/ct.h b/include/ct.h index aa0504c5..0a705fd0 100644 --- a/include/ct.h +++ b/include/ct.h @@ -40,5 +40,6 @@ extern const struct datatype ct_dir_type; extern const struct datatype ct_state_type; extern const struct datatype ct_status_type; extern const struct datatype ct_label_type; +extern const struct datatype ct_event_type; #endif /* NFTABLES_CT_H */ @@ -131,7 +131,7 @@ static const struct symbol_table ct_events_tbl = { }, }; -static const struct datatype ct_event_type = { +const struct datatype ct_event_type = { .type = TYPE_CT_EVENTBIT, .name = "ct_event", .desc = "conntrack event bits", diff --git a/src/datatype.c b/src/datatype.c index 81b8b4d5..675faa08 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -72,6 +72,7 @@ static const struct datatype *datatypes[TYPE_MAX + 1] = { [TYPE_ECN] = &ecn_type, [TYPE_FIB_ADDR] = &fib_addr_type, [TYPE_BOOLEAN] = &boolean_type, + [TYPE_CT_EVENTBIT] = &ct_event_type, [TYPE_IFNAME] = &ifname_type, [TYPE_IGMP_TYPE] = &igmp_type_type, [TYPE_TIME_DATE] = &date_type, |