From 6ab0fd6c67dbccedb49209b94eb7f740dd32fd2a Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Tue, 11 Apr 2023 21:45:34 +0100 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- src/json.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/json.c') 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)); -- cgit v1.2.3