From patchwork Sun Jan 19 17:20:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pablo Neira Ayuso X-Patchwork-Id: 13944536 X-Patchwork-Delegate: kuba@kernel.org Received: from mail.netfilter.org (mail.netfilter.org [217.70.188.207]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 072E71DF755; Sun, 19 Jan 2025 17:21:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.188.207 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737307268; cv=none; b=i6w7mVqHfmY6KT63IfdUwIpxVa2NIKiTMh/39EzXg0gFWbdnhKBImdEzjgB/NnarAXiclFdgmTeVAKF4Oo4yfId0lMQ585C3kNtTqiZr3EyKHMY7f4ESanu7sdzKpj5G4hSTHNxPKrMZ8JKtKj9gjD9MMcWXFwKosPNzSGiNSIo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737307268; c=relaxed/simple; bh=sOOiXELOLHGTDAG4yU5ZQHuv+9It1vE7voNAEewZqrM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CnPbfeCkXII12fIKFE4WjRMIlrHesn8wWR7LrutGME1Gi1jpfvfxZKC8t90hDwlrjdxlVfswsb5kT/WYvHXbNWDTqNaGHXTgyudBKH3zpMP9RFLq76jI4Qhtb+PQwbFLfsMRPblMPXG4Sg4EmKpHztPc0/3Xig9ZxOHSwKGQ+Fs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org; spf=pass smtp.mailfrom=netfilter.org; arc=none smtp.client-ip=217.70.188.207 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org From: Pablo Neira Ayuso To: netfilter-devel@vger.kernel.org Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, fw@strlen.de Subject: [PATCH net-next 06/14] netfilter: nf_tables: Compare netdev hooks based on stored name Date: Sun, 19 Jan 2025 18:20:43 +0100 Message-Id: <20250119172051.8261-7-pablo@netfilter.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250119172051.8261-1-pablo@netfilter.org> References: <20250119172051.8261-1-pablo@netfilter.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Phil Sutter 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 Signed-off-by: Pablo Neira Ayuso --- net/netfilter/nf_tables_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }