* [iptables PATCH] nft-bridge: Drop 'sreg_count' variable
@ 2022-09-28 17:18 Phil Sutter
2022-09-28 17:55 ` Florian Westphal
0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2022-09-28 17:18 UTC (permalink / raw)
To: Florian Westphal; +Cc: netfilter-devel
It is not needed, one can just use 'reg' function parameter in its
place.
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
iptables/nft-bridge.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/iptables/nft-bridge.c b/iptables/nft-bridge.c
index 596dfdf8991f1..d1385cc3593b9 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;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [iptables PATCH] nft-bridge: Drop 'sreg_count' variable
2022-09-28 17:18 [iptables PATCH] nft-bridge: Drop 'sreg_count' variable Phil Sutter
@ 2022-09-28 17:55 ` Florian Westphal
0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2022-09-28 17:55 UTC (permalink / raw)
To: Phil Sutter; +Cc: Florian Westphal, netfilter-devel
Phil Sutter <phil@nwl.cc> wrote:
> It is not needed, one can just use 'reg' function parameter in its
> place.
Thanks!
Acked-by: Florian Westphal <fw@strlen.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-28 17:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28 17:18 [iptables PATCH] nft-bridge: Drop 'sreg_count' variable Phil Sutter
2022-09-28 17:55 ` Florian Westphal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.