🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16843

[PATCH net-next 06/13] netfilter: nft_flow_offload: do not offload multicast

#16843
From: Pablo Neira Ayuso
Date: Mon, 16 Nov 2026 00:16
51 lines
10038 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: <20261116001612.2806263-7-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-363930-linux-kernel-netdev=dewy.ru
References: <20261116001612.2806263-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-363930-linux-kernel-netdev=dewy.ru
From: pablo@netfilter.org (Pablo Neira Ayuso)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next 06/13] netfilter: nft_flow_offload: do not offload multicast
Date: Mon, 16 Nov 2026 01:16:05 +0100
Organization: Usenet Network
Message-ID: <20261116001612.2806263-7-pablo@netfilter.org>
References: <20261116001612.2806263-1-pablo@netfilter.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1941393"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:f2Yb7DtZdbUKPmwgmsoYrQoCb4g= sha256:97/1qoE85dpRiW58BtmRPeMZNqKGRtMMnZGq6PcTgXo=
	sha1:jfngCpcT1BGgPVH6+mnzr/biuLY= sha256:tFL0EOpjyYVmyugOst3MICEUTKvLa62GpVqhOZmS4uk=
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 26544114AB9; Mon, 16 Nov 2026 03:17:06 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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] 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 OXRFFiH7xBFL;
	Mon, 16 Nov 2026 03:17:03 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-363930-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 3E4DD114AB4; Mon, 16 Nov 2026 03:16:55 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 01A3E2E128; Mon, 16 Nov 2026 00:16:53 +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=1794788209;
	b=NTaqyqFHnrZ+GVkX1puuEu3xyN2ua45cBDSc1XMnqly+SmNgQicooGaE9o8e/76fALL5
	 MVZV2ehUZwhSiySADQuV19PiVEecHCorsgf8KGkrP9Lyv3+zlmvZNXZD33gcNh2OcB8gP
	 A+CY5pNBztylKkoQV7Ah8J+DrZp6ANhDlu4QobcP3QqRxhympxWhFRrlM3SuxDOQFIfP2
	 Jd9EDQRd9XlGS9n9PLmHeS7RaBM4dEoMXDgZAYmZqXl+VGteobI4RN3YBaOeKgeFBqVoT
	 2ybZdtu+RIbAi7zZJ+JN0w7ieIocV3/E+JET2bfNbQd+mTiiMZCL1L8EULt3f2wQmAw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794788209;
	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=2WAOKraMUOcwPxFoii2Gl7KL51IIOpTUA2VmsXu0wExYohXvh6E2Farb7Tsy5h8Lhg5V
	 u2E8ncoAmbpcsphPNrBVE+XF/7zUc7d4FFMe2zC9a6zzw3WmXlYDHkkxj+pe9Ex3ZyTJw
	 ea4lYj4jbKdnMf7g0lubTMrV43KWXU3u0g62QyFYnJNKE2MROXWNDWejW5kIDjmoTTtH+
	 r9HlglgY5BxxWrnp5bKYAAFF5+8eaGKLx3QCxnWe0jH/atsiWNpMzldmJml6fbrycggLD
	 bwJAMgmSi56hzRjHDKvFPmE0ip42q8jOmzfoBumJKwf1yUhixQ7mQ28GzcW6nBNR5LA==
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=GRowouAx;
	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 A4BCA606A335;
	Mon, 16 Nov 2026 00:16:49 +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=GRowouAx
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=1794788208;
	b=4PPRwnUpaiLudV5O91ECDQLEQRxysMGwLff7vfqvEHhbT7WcKS/7RkBUJzHnVPZmzV33
	 CQb9VA6BqGo9HSP6/abO+w48llSbmp2w/mZnL8nUOphBLa4GlspXpB/Sut39NXci7u9Do
	 MdWP03cRm8C8C/IuAmZSFsMFHqfgPthbNDGLxp6gbKMIeD1WcoUzi8xjwWAMvQL3Xg9ju
	 3w6sdzLVNMPqPi12CC64C9K05I6NCQ8bDkWpEYFEXuuHl4dc8I4A++l3lJczK7k99RP/3
	 ZJV9knKc6Psli7odhk2/XG04SfTXJQk6TIYwj/KjtEvn3nLhlBNdb81b6+AhqCmCnXg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794788208;
	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=FocSHlxweJ9wYP0uAS8dNBdBQXRuA6gKPbinJnllSCvN5VvAdNGYP14urLdSoXEt5Lvt
	 ZjwayYb/o1y/PTH+qahEI1NKib+3lBj8URlWxN3weAl+TE2TWJryC9R7NsY77EeBhyX/9
	 soUq6yoqkXqhFZMWKasUMK8DBZvyjx+n0ZHXsKEw4n8NBd5A1Z1rwR4GkE4rhdf2AeYgS
	 ayRavkz5340Kv5pQeMgteX277KpWgOQjLtAW+2uPAziiFl6fDLJP3k+/rUqHiXOjleN4p
	 zxq1b4krfWfM3TMjlam8rBZczOxcwl2cIZscX1UVy9U2YpxiWGS2DG+tYtJ4oVFrU3A==
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=GRowouAx;
	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 50866606A31F;
	Mon, 16 Nov 2026 00:16:48 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 50866606A31F
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=1794788196;
	bh=aL0i2bOb5Au0I6UYZUML79qPFqmooqvj+Q5kLNFoTH0=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=GRowouAxsT51Rfq/xZpx+//P0iyZF4E7Tybw3B3p1xIFjrzFMFL0zR88+DMyIr0Oa
	 /aAzOq57aQNTDuFJtaJfxEhV/nFORCYUL8Z8N+iYA0JbQU/wAVLOKMbjEPrUrnweh1
	 LqLsGCeKGV7/SOd9qRz94pGga1sjJVqzjeZMtZhXojDk3fq8mUjJNTWjXvsSfzlaNG
	 NqFhZzCZEOdChi5kDLtHRo+GWzd0YA7hab2WFn1Pui5i1ejrJybADqYJ6mnyF0jPtn
	 ObE25e3da+/hBtIEluU7mJHRTXD8lqib9eaSdMSug67mPh5nQJUuhW5f1NFaS3qb0w
	 WbZ49ZhLAkHXQ==
X-Received: from localhost.localdomain (mail-agni [217.70.190.124])
	by mail.netfilter.org (Postfix) with ESMTPSA id 6CBF56005E;
	Mon, 16 Nov 2026 01:16:35 +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: <20261116001612.2806263-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