]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nft-bridge: Drop 'sreg_count' variable
authorPhil Sutter <phil@nwl.cc>
Wed, 28 Sep 2022 16:42:02 +0000 (18:42 +0200)
committerPhil Sutter <phil@nwl.cc>
Wed, 28 Sep 2022 18:06:12 +0000 (20:06 +0200)
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>
iptables/nft-bridge.c

index 596dfdf8991f172369eca5d9f90fe04d0335523f..d1385cc3593b97b47ff7085c9e467b2f245bc3cf 100644 (file)
@@ -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;