netfilter: nft_compat: fix wrong target lookup in nft_target_select_ops()
authorArturo Borrero <arturo.borrero.glez@gmail.com>
Sun, 26 Oct 2014 11:22:40 +0000 (12:22 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 27 Oct 2014 21:17:46 +0000 (22:17 +0100)
The code looks for an already loaded target, and the correct list to search
is nft_target_list, not nft_match_list.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_compat.c

index 0480f57a4eb6c62da5b02951e51db77d4af3e0b4..9d6d6f60a80fc6b23da9bb140c90e085a4fa675a 100644 (file)
@@ -672,7 +672,7 @@ nft_target_select_ops(const struct nft_ctx *ctx,
        family = ctx->afi->family;
 
        /* Re-use the existing target if it's already loaded. */
-       list_for_each_entry(nft_target, &nft_match_list, head) {
+       list_for_each_entry(nft_target, &nft_target_list, head) {
                struct xt_target *target = nft_target->ops.data;
 
                if (strcmp(target->name, tg_name) == 0 &&