summaryrefslogtreecommitdiffstats
path: root/iptables/nft-bridge.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2022-09-28 18:42:02 +0200
committerPhil Sutter <phil@nwl.cc>2022-09-28 20:06:12 +0200
commit6ffd3674af160b7e59b480d13a12bf82bea32f04 (patch)
tree0bec4f27effc5cc7a0a56aeb4976e8dee7d532e5 /iptables/nft-bridge.c
parent66806feef085c0504966c484f687bdf7b09510e3 (diff)
nft-bridge: Drop 'sreg_count' variable
It is not needed, one can just use 'reg' function parameter in its place. Signed-off-by: Phil Sutter <phil@nwl.cc> Acked-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/nft-bridge.c')
-rw-r--r--iptables/nft-bridge.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/iptables/nft-bridge.c b/iptables/nft-bridge.c
index 596dfdf8..d1385cc3 100644
--- a/iptables/nft-bridge.c
+++ b/iptables/nft-bridge.c
@@ -324,7 +324,6 @@ static int lookup_analyze_payloads(struct nft_xt_ctx *ctx,
bool *dst, bool *ip)
{
const struct nft_xt_ctx_reg *reg;
- uint32_t sreg_count;
int val, val2 = -1;
reg = nft_xt_ctx_get_sreg(ctx, sreg);
@@ -336,7 +335,6 @@ static int lookup_analyze_payloads(struct nft_xt_ctx *ctx,
return -1;
}
- sreg_count = sreg;
switch (key_len) {
case 12: /* ether + ipv4addr */
val = lookup_check_ether_payload(reg->payload.base,
@@ -349,9 +347,9 @@ static int lookup_analyze_payloads(struct nft_xt_ctx *ctx,
return -1;
}
- sreg_count = nft_get_next_reg(sreg_count, ETH_ALEN);
+ sreg = nft_get_next_reg(sreg, ETH_ALEN);
- reg = nft_xt_ctx_get_sreg(ctx, sreg_count);
+ reg = nft_xt_ctx_get_sreg(ctx, sreg);
if (!reg) {
ctx->errmsg = "next lookup register is invalid";
return -1;