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

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