netfilter: nft_lookup: remove superfluous element found check
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 20 Sep 2016 16:22:46 +0000 (18:22 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 23 Sep 2016 07:30:48 +0000 (09:30 +0200)
We already checked for !found just a bit before:

        if (!found) {
                regs->verdict.code = NFT_BREAK;
                return;
        }

        if (found && set->flags & NFT_SET_MAP)
            ^^^^^

So this redundant check can just go away.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_lookup.c

index e164325d1bc05d66d6a4fb296a2a3d6778ef15ce..8166b6994cc75dcd6a556172ae541c13ce337fc4 100644 (file)
@@ -43,7 +43,7 @@ static void nft_lookup_eval(const struct nft_expr *expr,
                return;
        }
 
-       if (found && set->flags & NFT_SET_MAP)
+       if (set->flags & NFT_SET_MAP)
                nft_data_copy(&regs->data[priv->dreg],
                              nft_set_ext_data(ext), set->dlen);