summaryrefslogtreecommitdiffstats
path: root/src/json.c
diff options
context:
space:
mode:
authorJeremy Sowden <jeremy@azazel.net>2023-04-11 21:45:34 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2023-06-01 21:43:16 +0200
commit6ab0fd6c67dbccedb49209b94eb7f740dd32fd2a (patch)
tree8f376a718fd3c1bc28577a6fb00ec5c3ccdf9133 /src/json.c
parent19245dd1e0c8e1e007a3b98527e379337d57b49a (diff)
exthdr: add boolean DCCP option matching
Iptables supports the matching of DCCP packets based on the presence or absence of DCCP options. Extend exthdr expressions to add this functionality to nftables. Link: https://bugzilla.netfilter.org/show_bug.cgi?id=930 Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/json.c b/src/json.c
index 1b42ebc0..981d177b 100644
--- a/src/json.c
+++ b/src/json.c
@@ -751,6 +751,11 @@ json_t *exthdr_expr_json(const struct expr *expr, struct output_ctx *octx)
return json_pack("{s:o}", "tcp option", root);
}
+ if (expr->exthdr.op == NFT_EXTHDR_OP_DCCP) {
+ root = json_pack("{s:i}", "type", expr->exthdr.raw_type);
+ return json_pack("{s:o}", "dccp option", root);
+ }
+
root = json_pack("{s:s}", "name", desc);
if (!is_exists)
json_object_set_new(root, "field", json_string(field));