]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
datatype: initialize TYPE_CT_EVENTBIT slot in datatype array
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 19 Sep 2023 16:15:17 +0000 (18:15 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 20 Sep 2023 15:52:13 +0000 (17:52 +0200)
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>
include/ct.h
src/ct.c
src/datatype.c

index aa0504c5ace746a3ba06b5666a02988fe97443ab..0a705fd06ee14b0a8fc2da42ac0ddb49dd5e00b5 100644 (file)
@@ -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 */
index d7dec25559b389dff498c384ad028158c41c3773..b2635543e6ec9bdaa47b61bf73a43297813b3776 100644 (file)
--- a/src/ct.c
+++ b/src/ct.c
@@ -132,7 +132,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",
index ee0e970141859f1c202d93718948b764c6275d67..14d5a0e60146208f9ba823786dd9ab21e515ac87 100644 (file)
@@ -75,6 +75,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,