Article View: linux.kernel.netdev
Article #15539[PATCH net-next 07/15] netfilter: nft_flow_offload: do not offload multicast
From: Pablo Neira Ayuso
Date: Fri, 13 Nov 2026 03:12
Date: Fri, 13 Nov 2026 03:12
51 lines
10035 bytes
10035 bytes
From: Koral Ilgun <koral.ilgun@adtran.com>
A flow holds one output per direction, which it resolves when it is
added. The outputs of a multicast route change when listeners join
or leave. So a multicast flow in the flowtable continues to send to
the output that it resolved, also after the last listener left, and
the counters of the multicast routing stop.
A ruleset can keep multicast out with a match before the flow
offload statement. Without one, IPv4 multicast stays out of the
flowtable only because the reverse route lookup in nft_flow_route()
refuses a multicast source address. The IPv6 route lookup has no such
check, so IPv6 multicast that ip6mr forwards goes into the flowtable.
Skip a multicast destination for both families in the flow offload
expression itself, so that the result no longer depends on the
ruleset or on the route lookup.
Signed-off-by: Koral Ilgun <koral.ilgun@adtran.com>
Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nft_flow_offload.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/netfilter/nft_flow_offload.c b/net/netfilter/nft_flow_offload.c
index d3c5651dd699..530e20c7fd45 100644
--- a/net/netfilter/nft_flow_offload.c
+++ b/net/netfilter/nft_flow_offload.c
@@ -10,6 +10,7 @@
#include <linux/netfilter/nf_conntrack_common.h>
#include <linux/netfilter/nf_tables.h>
#include <net/ip.h>
+#include <net/ipv6.h>
#include <net/flow.h>
#include <net/netfilter/nf_tables.h>
#include <net/netfilter/nf_tables_core.h>
@@ -33,6 +34,10 @@ static bool nft_flow_offload_skip(struct sk_buff *skb, int family)
if (unlikely(opt->optlen))
return true;
+
+ return ipv4_is_multicast(ip_hdr(skb)->daddr);
+ } else if (family == NFPROTO_IPV6) {
+ return ipv6_addr_is_multicast(&ipv6_hdr(skb)->daddr);
}
return false;
--
2.47.3
Technical Details
Message-ID:
<20261113031251.2437074-8-pablo@netfilter.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362391-linux-kernel-netdev=dewy.ruReferences:
<20261113031251.2437074-1-pablo@netfilter.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362391-linux-kernel-netdev=dewy.ru From: pablo@netfilter.org (Pablo Neira Ayuso) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next 07/15] netfilter: nft_flow_offload: do not offload multicast Date: Fri, 13 Nov 2026 04:12:43 +0100 Organization: Usenet Network Message-ID: <20261113031251.2437074-8-pablo@netfilter.org> References: <20261113031251.2437074-1-pablo@netfilter.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1252507"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:o9INCc3u3V9p0WpzNcxZVWuar94= sha256:TFxb9b9zdEBph+s6xY9/uxFpieV22EUZ+0hzw6uTiDw= sha1:ilx9olKq4X8d361KA4WQcL6skw8= sha256:WQq1ye9uxQ8mI6gs85fCg0Y92j6IvEuVANABQrGt/1w= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 443A6114456; Fri, 13 Nov 2026 06:26:34 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.15 X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=netfilter.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8aqjs8No8-gm; Fri, 13 Nov 2026 06:26:30 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-362391-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=netfilter.org X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id C6BCF114450; Fri, 13 Nov 2026 06:26:21 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 81470625216; Fri, 13 Nov 2026 03:13:54 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1794539588; b=HvIPjnVv2lxZRzQA7AyLE177SAnWrf1c1YhCZlaovp7AuhmcW2N+aOCQuKUqfn9P+C2A /9n85x5RyWHQTPfJCPLpO4oGQ0N88BpFTnJCMzSMOKjztZgjASfuaL2NIJJ+3PQZzsatl dxecDQtD0yznNdgNzHcrdNP/t+6faDbxUx+29uY3a2//6uzbxvA4aw6rCKcfKy0NNoC9K uei7CBMZh2Qf/hG/2PQDUmB6G81rgBKCc3OWUK2HHrimTWbwE94VwGMlnNKLb2xSxncUr Pxc76VsWmBLBEywQqjybRka2ZpJ1CnvvyOYkaBAxuWKBMLh9YeVC+OtbJfnwJqycPMQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794539588; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To: Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=aL0i2bOb5Au0I6UYZUML79qPFqmooqvj+Q5kLNFoTH0=; b=vyi4HOREL8Zc1migy13h8GeynZQaGLuf//1EtRZiIT688NHo8N3ywa6XR4mih+I/jC7j jr/7RUbLN/lnVY43q3bOiIfkrFm+hwemvku/oJ6ud0PfUKe02r0DZmJbMY3poQbgpbQE7 K8xpAR58ZE6c6vZM3IRjWgdd5w3HoZkCg8FS7yDSVMe4uIV0YollcyYXG97BrsFhlT5tn 38rC3rpy0fstfmhPqDZxARXRWXpAUcxvV1B7z4aShMnTJGz3OT/NGglfwtOvf6YO7DuL/ UXGyR+2AjBi2NyH0ImkAChmI86PI85lZK0uZ0yNuxSWt/ZL4nPcO01c4VdIpM3n/7NA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=k97wVshJ; dmarc=none header.from=netfilter.org; spf=pass smtp.mailfrom=netfilter.org; arc=fail smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 965AD60A2610; Fri, 13 Nov 2026 03:13:08 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=k97wVshJ X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.70.190.124 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794539587; b=k6Oxw9uneJNcShNmenOUEGdwtFCymaIdXSi+UHY6NDOzZmgtMxsp2+I/cFHR+f6eV6vI y2wgxxgcugnjLQhwe3DnwGrYVrTTv2mbszRbK4w5DH5O9ReV57qfyQ2v68xGm5qM9M7gC VMm5kN7+H/SbJZihMyBcesaylAESeHgRJ4bwqgweqY+1wGA+WZ11VYrlS95RbAX5Ihh7K th3D/clRaOV0f3X8i72P+kFtt2RYNsWZ16QCFOrgxj25ShPI1Vc56HP7K/eJ6I2+LFpaT m4gOtQOSfcHIAOfr7JQ3IIrWoXXPVTls6k0PVp8qj7upFmqJqSG2oIqtYK0DJdF0+ng== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794539587; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Spam-Status:X-Spam-Checker-Version; bh=aL0i2bOb5Au0I6UYZUML79qPFqmooqvj+Q5kLNFoTH0=; b=d4XLF1CRZH54SHjo7QxA2D39fKdq4P3FXpT63M8lRhoNo47GSX0E3IjsDbUoKbS1PG2L tL5DhwoWkpyxbBcsEHDlL8elf0V68G/rMjMzFHMgG3NLT6evonHXk1PRmpZXI2Rcut+a0 7BNKC5j/dvG+qvk1woz00ZBZ9o/YkpI7i6MDemMXzG8FWTTdvmogfq+o59F3BrL4Cqr9N +0KHOG+v9CBzjXh4Db8CfAzA8cdseUsxZ0t1Y3VrS4acRaV5TlbL+P+WusRLdDKCwJN9Q ZMuEsZICk6Grn5ocdGnAUPYp4Bp34krA0n2sTiYOZk6dlf1t9Ow1r51SFIy+plbReQw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=netfilter.org; spf=pass smtp.mailfrom=netfilter.org; dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=k97wVshJ; arc=none smtp.remote-ip=217.70.190.124 X-Received: from mail.netfilter.org (mail.netfilter.org [217.70.190.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D9F4606A336; Fri, 13 Nov 2026 03:13:07 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4D9F4606A336 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org; s=2025; t=1794539585; bh=aL0i2bOb5Au0I6UYZUML79qPFqmooqvj+Q5kLNFoTH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k97wVshJ5U2NxhIuwy4+AGzxeyWvglvAEO9SP7limf1akzPt/BKNWuwH/nVpoyZa7 dJ+q5tPDLV51hCyi6wx1Bposy++xaY/G4CnJ2ysoXSp7DXyqzl4AOyYGiEkxJ7oePf LdF57A7qLLq5iMAVlSs+IZF6aotpU0GWIpZLspdvyhmdbg2M/oMKDhJF8QYRKbac1v jMF4nJC6oUTruTrmajuK5q+MKksEmeboxyeHpu/UpcX7C9wIeiutLBNcNAZJamjfxB 3GZEyy6GIFjB0X6J6+OmHIf+A9reY2o91lX96Z+nlybf1DFJp5lng8zjLN3V7XVord Lv8ycqLctqyqQ== X-Received: from localhost.localdomain (mail-agni [217.70.190.124]) by mail.netfilter.org (Postfix) with ESMTPSA id 3B394602A5; Fri, 13 Nov 2026 04:13:05 +0100 (CET) X-Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org, horms@kernel.org, fw@strlen.de, ja@ssi.bg X-Mailer: git-send-email 2.47.3 X-In-Reply-To: <20261113031251.2437074-1-pablo@netfilter.org> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list