From 5e7304e12518ecb38ff45746650b5362f975500d Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 2 Jan 2023 15:36:23 +0100 Subject: src: add dl_proto_ctx() Add dl_proto_ctx() to access protocol context (struct proto_ctx and struct payload_dep_ctx) from the delinearize path. This patch comes in preparation for supporting outer and inner protocol context. Signed-off-by: Pablo Neira Ayuso --- src/xt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/xt.c') diff --git a/src/xt.c b/src/xt.c index 9bfd8a2f..2405d3c3 100644 --- a/src/xt.c +++ b/src/xt.c @@ -267,10 +267,12 @@ static bool is_watcher(uint32_t family, struct stmt *stmt) void stmt_xt_postprocess(struct rule_pp_ctx *rctx, struct stmt *stmt, struct rule *rule) { - if (is_watcher(rctx->pctx.family, stmt)) + struct dl_proto_ctx *dl = dl_proto_ctx(rctx); + + if (is_watcher(dl->pctx.family, stmt)) stmt->xt.type = NFT_XT_WATCHER; - stmt->xt.proto = xt_proto(&rctx->pctx); + stmt->xt.proto = xt_proto(&dl->pctx); } static int nft_xt_compatible_revision(const char *name, uint8_t rev, int opt) -- cgit v1.2.3