diff mbox series

[net-next,06/14] netfilter: nf_tables: Compare netdev hooks based on stored name

Message ID 20250116171902.1783620-7-pablo@netfilter.org
State Changes Requested
Headers show
Series [net-next,01/14] netfilter: nf_tables: fix set size with rbtree backend | expand

Commit Message

Pablo Neira Ayuso Jan. 16, 2025, 5:18 p.m. UTC
From: Phil Sutter <phil@nwl.cc>

The 1:1 relationship between nft_hook and nf_hook_ops is about to break,
so choose the stored ifname to uniquely identify hooks.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nf_tables_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 87175cd1d39b..ed15c52e3c65 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2317,7 +2317,7 @@  static struct nft_hook *nft_hook_list_find(struct list_head *hook_list,
 	struct nft_hook *hook;
 
 	list_for_each_entry(hook, hook_list, list) {
-		if (this->ops.dev == hook->ops.dev)
+		if (!strcmp(hook->ifname, this->ifname))
 			return hook;
 	}