๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23216

Re: [PATCH net-next v2 06/12] amt: size the encapsulation headroom by the outer IP version

#23216
From: netdev-bot+sashiko
Date: Thu, 26 Nov 2026 19:17
75 lines
10691 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message names the wrong drop site for the packets it
  is meant to protect.

--

amt: size the encapsulation headroom by the outer IP version

This adds AMT_RELAY_HLEN6 and AMT_GW_HLEN6 and a new helper, amt_hlen(),
that picks the IPv4 or IPv6 headroom size for the device's outer family.
amt_hlen() is then used to size needed_headroom, mtu, max_mtu and
min_mtu in amt_newlink(), and the new MTU on NETDEV_CHANGEMTU in
amt_device_event().

> The amt device reserves AMT_RELAY_HLEN or AMT_GW_HLEN of headroom and
> subtracts the same amount from the stream device's MTU. Both assume a
> 20-byte IPv4 outer header. An IPv6 outer header is 40 bytes, so on an
> IPv6 device an inner packet in the last 20 bytes below the MTU would
> not fit the stream device once encapsulated, and ip6_fragment() drops
> it: nothing sets ignore_df on the tunnel skb.

[Severity: Low]

Is this description accurate for this tree? The previous patch in the
series, "amt: forward multicast data over IPv6", added a tunnel MTU check
to the relay's bulk transmit path. The check runs before encapsulation:

drivers/net/amt.c:amt_send_multicast_data() {
    ...
		tmtu = amt_tmtu(dst);
		if (amt_tmtu_exceeded(oskb, tmtu)) {
			dst_release(dst);
			...
			DEV_STATS_INC(amt->dev, tx_dropped);
			return;
		}
    ...
}

amt_tmtu() returns:

	return dst_mtu(dst) - sizeof(struct ipv6hdr) - sizeof(struct udphdr) -
	       sizeof(struct amt_header_mcast_data);

That is dst_mtu - 50.

An inner packet that does not fit is dropped here, before
skb_copy_expand() and amt_udp_xmit() are called, so it never reaches
ip6_fragment(). The drop is counted in tx_dropped, and *ptb is lowered
so amt_dev_xmit() sends a Packet Too Big if the payload is IPv6. An IPv4
multicast payload is dropped without notice, because icmp_send() does
not answer multicast.

The size of the window also seems different from what the message
says. sizeof(struct amt_relay_headers) is 12, so the old relay MTU is
stream_mtu - 40 and the tunnel MTU is stream_mtu - 50. The affected
packets fall in a 10-byte window, not the last 20 bytes.

The other relay sends (Advertisement, Membership Query) are small
control messages. The gateway's Membership Update only carries IGMP/MLD
reports.

The code change itself looks right. Only the stated reason seems off.
Could the commit message say that the relay's own tunnel MTU check in
amt_send_multicast_data() drops these packets, and that IPv4 multicast
payloads are dropped without notice?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125191450.2497936-1-omar%40blockcast.net
Technical Details
Message-ID: <179572062093.3135.571620247087203844@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372294-linux-kernel-netdev=dewy.ru
References: <20261125191450.2497936-7-omar@blockcast.net>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372294-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 06/12] amt: size the encapsulation headroom by
 the outer IP version
Date: Thu, 26 Nov 2026 19:17:00 +0000
Organization: Usenet Network
Message-ID: <179572062093.3135.571620247087203844@kernel.org>
References: <20261125191450.2497936-7-omar@blockcast.net>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="542532"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:L7ReFmzi1SegdnmgDc2l2NDz7Ek= sha256:bmzs7X0UWv3KQWymue/oLbm5mkhhh8quileRRKHYYyk=
	sha1:OqVZGptGWKX2GOwz9nKq+v1clwg= sha256:PL4JPzXkohNMCPLx6PJATTRLBYipa50paLyF9YMLLd0=
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 6E389125EF8; Thu, 26 Nov 2026 22:17:37 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	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=kernel.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 DJCAK2osRhbM;
	Thu, 26 Nov 2026 22:17:33 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-372294-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 0BD77125EF6; Thu, 26 Nov 2026 22:17:25 +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 C80F031D5E; Thu, 26 Nov 2026 19:17:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795720628;
	b=qjREI7u6gNgXsaaMHP+fsX1PbFeu5wI1DedaospJO4ZdrWMeESDegMPPzG1qcDogNDL3
	 l/gkoC8wdWhYnuoeQGbA4Fuq0Gd9NoBs9UoxTepdaVL9yi7tkOWNxihp/xKs9C482OdCU
	 DwLZ5CfBjEwaEtDeFe0hehonYzMucXvLtYEQhpWEwp/x0GFSeNC/8dqdQYfE+5VtWbzpS
	 7L5EPaOnRwSM5rkUgoTR/5W3sqZ3jBBEw2ULRnzzbz+11Ryzenu5VlMEMEtkyIkVz9OVE
	 GNU+k6lS6pEAK+cuzciARC3cf2IP7auIy+tj2u+PD11vzmiVtArOu/DBuWNAihY2qeQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795720628;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=9OqSVe81H/kFXVcsDosZylHfevYu8i9Vnq49ubXZbkE=;
	b=eHc/FY8m8Z9BrBszUxKl8bSJpLHp1ev0mCgs6mKrPCgRNmNPzzCbNhg+PulRI+Wc9722
	 BDvG4yE0Iz71zUry7fqvFtN9ZICYzsaDEyHozLDRq8gahLelFXYrVxkq5F6V3ohK4VZ51
	 gC/TEgdO5MPfxlrTKk82dY2HrecjE9kZtY9aCLeLWDOBD5XuTtvOuEJbXjk+oJQb/CtVK
	 x1J/KDkpk+oeezhwmzfx+rRtpuvViZFyzaISmZe4Lp7d3/8A5Vy75WxZfnTceAYT//Q/y
	 dbj55B5/nvnkKxktK5xGJJ78dcshaian0XoSPBu/Kd9XXL1+KNOK0uziZpttxz0Go9g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=n5d3XGnU;
	arc=pass header.oldest-pass=0 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 5853E606A69C;
	Thu, 26 Nov 2026 19:17:08 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=n5d3XGnU
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795720622;
	b=tRwFOo2loC0ksXU3fOg097GFmsUWVp44wOikSHQY4WKE910rtuEZTTmxTt9COBVWKUr+
	 Egbj6IL7fGzdG4J3o7sSW/TC0rjPpmHCZtPn+ySRwvDaTpl1Vjkb7rFpoUYu5moFKi7AR
	 O/NFvt0c6Xqbyj8eSt47z9eYohunu2bAojZCRhEv1HICAs0L9559odkpWlKzFhydiG0tP
	 t7yj0vOmWrCP4fMr027VIz8EpNf5LEJ2c949yK1bsKx7bmXFJRzP2HFl8y8vWqVdz9/DD
	 T80+WLOfNPwvmgooO5mdjeznOCgoXOkkvuuwo8GVf0l9GikvbdrNFyYZOglIqqmH2uw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795720622;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=9OqSVe81H/kFXVcsDosZylHfevYu8i9Vnq49ubXZbkE=;
	b=PHwB5NZ1UNjvuVIPDB2vD84irK+yyrlWqo9BpEwB+46d+qtbqErah+yGtAibVhINJoQx
	 ZlYkQlJRsKyQ6i6u1HqjN1Hx6r4CyKdp/z8W5fJts1DLSpxWORM6Ss0zf/3tcjIx/GsT4
	 1oF9zQjFwBZ1k/HZxnxi4XuzNkZkQq7yGhOyYDUBVmxAHJgX5Pp3FIDb/xSlcHIZUTPXj
	 w0dccO7q9FzVUVkodRJmpZj3Fj4hCFX0+CBxfPX3m/E4Y8jkvibMaBUj3OhE39zuXXYRr
	 RIqpSQAJGEVfZBGZMwf+RNUut2oeEUA1NWQoRJuXkguyhuDKXOAST8ZoCNVVxGD3rzw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=n5d3XGnU;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(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 79CB7606A6A2;
	Thu, 26 Nov 2026 19:17:02 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EB1D1F000D4;
	Thu, 26 Nov 2026 19:17:01 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795720622;
	bh=9OqSVe81H/kFXVcsDosZylHfevYu8i9Vnq49ubXZbkE=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=n5d3XGnUAE1dtcrhVMepc7/5xGdGLWaWhjfeXJaaIBSvz20lnOAimPH/UcUXM03Ha
	 rQ99HuqmekVytvtPUFfg5765tqorSGn0xtzt5+Ea+4fUgbBxJK+nJ6NlPAHzGOlZvY
	 QSD9iQxuXxJZYlJzfmcBY/gWcuM/h0uZikSE0lCjF5eIlKlBKmyKzYVbmIk7dSgLjH
	 6rPuxlPLPW8+ANeMaPpOiWLySXaZS0JrgehjivWOPiSlNJ7hmSIxQPghe4Seri0g06
	 EtjPTwBHtF+PY80WeZL8pRfBIC4ikbbw5iYpsQcfwPobXmazvFDjAWcmHf1eLq7Ouq
	 vwE3aH0B/eVzQ==
X-Cc: ap420073@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org,
 horms@kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
 linux-kernel@vger.kernel.org
X-In-Reply-To: <20261125191450.2497936-7-omar@blockcast.net>
X-sashiko-severity: Low
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