evaluate: fix inet nat with no layer 3 info
Pablo Neira Ayuso
maintainerPATCH 1/1 evaluate: fix inet nat with no layer 3 info
nft currently reports:
Error: Could not process rule: Protocol error
add rule inet x y meta l4proto tcp dnat to :80
^^^^
default to NFPROTO_INET family, otherwise kernel bails out EPROTO when trying to load the conntrack helper.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- src/evaluate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
src/evaluate.c +3 -2
@@ -2997,9 +2997,10 @@ static int nat_evaluate_family(struct eval_ctx *ctx, struct stmt *stmt) stmt->nat.family = ctx->pctx.family;return 0 ;case NFPROTO_INET : -if (!stmt->nat.addr) +if (!stmt->nat.addr) { + stmt->nat.family =NFPROTO_INET ;return 0 ; - + }if (stmt->nat.family !=NFPROTO_UNSPEC )return 0 ;
Signature · 1 line
2.30.2