Skip to contentSkip to conversation

nft: Fix compile with -DDEBUG

PATCH New Phil Sutter 1 participant 1 message Oct 7, 2022 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 nft: Fix compile with -DDEBUG

Conversion from 'ctx' to 'reg' missed some of the DEBUGP() calls.

Fixes f315af1cf8871 ("nft: track each register individually")
---
 iptables/nft-bridge.c | 8 ++++----
 iptables/nft-ipv6.c   | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
iptables/nft-bridge.c +4 -4
index d1385cc3593b9..749cbc6fbbaf1 100644
@@ -365,8 +365,8 @@ static int lookup_analyze_payloads(struct nft_xt_ctx *ctx,
 						  reg->payload.len);
 		if (val2 < 0) {
 			DEBUGP("unknown payload base/offset/len %d/%d/%d\n",
-			       ctx->payload.base, ctx->payload.offset,
-			       ctx->payload.len);
+			       reg->payload.base, reg->payload.offset,
+			       reg->payload.len);
 			return -1;
 		} else if (val != val2) {
 			DEBUGP("mismatching payload match offsets\n");
@@ -379,8 +379,8 @@ static int lookup_analyze_payloads(struct nft_xt_ctx *ctx,
 						 reg->payload.len);
 		if (val < 0) {
 			DEBUGP("unknown payload base/offset/len %d/%d/%d\n",
-			       ctx->payload.base, ctx->payload.offset,
-			       ctx->payload.len);
+			       reg->payload.base, reg->payload.offset,
+			       reg->payload.len);
 			return -1;
 		}
 		break;
iptables/nft-ipv6.c +1 -1
index 05d65fbb46247..7ca9d842f2b1a 100644
@@ -173,7 +173,7 @@ static void nft_ipv6_parse_payload(struct nft_xt_ctx *ctx,
 		nft_parse_hl(ctx, e, cs);
 		break;
 	default:
-		DEBUGP("unknown payload offset %d\n", ctx->payload.offset);
+		DEBUGP("unknown payload offset %d\n", reg->payload.offset);
 		break;
 	}
 }
Signature · 1 line
2.34.1