From 226a0e072d5c1edeb53cb61b959b011168c5c29a Mon Sep 17 00:00:00 2001 From: Stephen Suryaputra Date: Wed, 3 Jul 2019 20:30:52 -0400 Subject: exthdr: add support for matching IPv4 options Add capability to have rules matching IPv4 options. This is developed mainly to support dropping of IP packets with loose and/or strict source route route options. Signed-off-by: Stephen Suryaputra Signed-off-by: Pablo Neira Ayuso --- src/json.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/json.c') diff --git a/src/json.c b/src/json.c index 1484c21b..1006d7bb 100644 --- a/src/json.c +++ b/src/json.c @@ -634,6 +634,14 @@ 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_IPV4) { + root = json_pack("{s:s}", "name", desc); + + if (!is_exists) + json_object_set_new(root, "field", json_string(field)); + + return json_pack("{s:o}", "ip option", root); + } root = json_pack("{s:s}", "name", desc); -- cgit v1.2.3