Skip to contentSkip to conversation

netfilter: nft_compat: fix wrong target lookup in nft_target_select_ops()

PATCH Applied Arturo Borrero Gonzalez 2 participants 2 messages Oct 26, 2014 – Oct 27, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: nft_compat: fix wrong target lookup in nft_target_select_ops()

The code looks for an already loaded target, and the correct list to search is nft_target_list, not nft_match_list.

---
NOTE: Compile-tested only.

 net/netfilter/nft_compat.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nft_compat.c +1 -1
index 7e2683c..4f28109 100644
@@ -611,7 +611,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 &&
maintainer Applied
#1 lore raw
Quoted 2 lines · Arturo Borrero Gonzalez

The code looks for an already loaded target, and the correct list to search is nft_target_list, not nft_match_list.

Applied, thanks.