Blame SOURCES/0074-evaluate-fix-inet-nat-with-no-layer-3-info.patch

96192c
From 1fe92af5a03608b94e8e1e2ff26e24adfe2ea09a Mon Sep 17 00:00:00 2001
96192c
From: Phil Sutter <psutter@redhat.com>
96192c
Date: Fri, 21 Jan 2022 12:35:39 +0100
96192c
Subject: [PATCH] evaluate: fix inet nat with no layer 3 info
96192c
96192c
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2030773
96192c
Upstream Status: nftables commit 9a36033ce5063
96192c
96192c
commit 9a36033ce50638a403d1421935cdd1287ee5de6b
96192c
Author: Pablo Neira Ayuso <pablo@netfilter.org>
96192c
Date:   Tue Jul 20 18:59:44 2021 +0200
96192c
96192c
    evaluate: fix inet nat with no layer 3 info
96192c
96192c
    nft currently reports:
96192c
96192c
     Error: Could not process rule: Protocol error
96192c
     add rule inet x y meta l4proto tcp dnat to :80
96192c
                                        ^^^^
96192c
96192c
    default to NFPROTO_INET family, otherwise kernel bails out EPROTO when
96192c
    trying to load the conntrack helper.
96192c
96192c
    Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1428
96192c
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
96192c
---
96192c
 src/evaluate.c | 5 +++--
96192c
 1 file changed, 3 insertions(+), 2 deletions(-)
96192c
96192c
diff --git a/src/evaluate.c b/src/evaluate.c
96192c
index 9381f23..e495faf 100644
96192c
--- a/src/evaluate.c
96192c
+++ b/src/evaluate.c
96192c
@@ -2757,9 +2757,10 @@ static int nat_evaluate_family(struct eval_ctx *ctx, struct stmt *stmt)
96192c
 			stmt->nat.family = ctx->pctx.family;
96192c
 		return 0;
96192c
 	case NFPROTO_INET:
96192c
-		if (!stmt->nat.addr)
96192c
+		if (!stmt->nat.addr) {
96192c
+			stmt->nat.family = NFPROTO_INET;
96192c
 			return 0;
96192c
-
96192c
+		}
96192c
 		if (stmt->nat.family != NFPROTO_UNSPEC)
96192c
 			return 0;
96192c
 
96192c
-- 
96192c
2.31.1
96192c