🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #3267

[PATCH net-next v9 6/8] hsr: Assign a socket for cloned skbs

#3267
From: Sebastian Andrzej Siewior
Date: Wed, 14 Oct 2026 14:44
52 lines
8752 bytes
The cloned skb does not have a socket information recorded of
the original skb. The original skb is never submitted. This means the
requested timestamp information gets lost.

This does not consider PRP part of the stack. The specification says
that PTP-PRP packets do not have the RCT therefore these packages can be
sent directly from userland skipping the stack.

Assign the socket of the original skb to the clone so the timestamp is
forwarded to the user.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 net/hsr/hsr_forward.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
index 534798da48d53..e3a7affd947a1 100644
--- a/net/hsr/hsr_forward.c
+++ b/net/hsr/hsr_forward.c
@@ -12,6 +12,7 @@
 #include <linux/skbuff.h>
 #include <linux/etherdevice.h>
 #include <linux/if_vlan.h>
+#include <net/sock.h>
 #include "hsr_main.h"
 #include "hsr_framereg.h"
 
@@ -347,6 +348,9 @@ struct sk_buff *hsr_create_tagged_frame(struct hsr_frame_info *frame,
 	if (!skb)
 		return NULL;
 
+	if (frame->req_tx_port != HSR_PT_NONE && frame->skb_std->sk)
+		skb_set_owner_w(skb, frame->skb_std->sk);
+
 	if (port->dev->features & NETIF_F_HW_HSR_TAG_INS)
 		return skb;
 
@@ -579,6 +583,8 @@ static void hsr_forward_do(struct hsr_frame_info *frame)
 		 */
 		if (frame->has_foreign_header && frame->skb_std) {
 			skb = skb_clone(frame->skb_std, GFP_ATOMIC);
+			if (skb && frame->skb_std->sk)
+				skb_set_owner_w(skb, frame->skb_std->sk);
 			goto inject_into_stack;
 		}
 

-- 
2.55.0
Technical Details
Message-ID: <20261014-hsr_ptp-v9-6-2d20a2a0f816@linutronix.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346321-linux-kernel-netdev=dewy.ru
References: <20261014-hsr_ptp-v9-0-2d20a2a0f816@linutronix.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346321-linux-kernel-netdev=dewy.ru
From: bigeasy@linutronix.de (Sebastian Andrzej Siewior)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v9 6/8] hsr: Assign a socket for cloned skbs
Date: Wed, 14 Oct 2026 16:44:00 +0200
Organization: Usenet Network
Message-ID: <20261014-hsr_ptp-v9-6-2d20a2a0f816@linutronix.de>
References: <20261014-hsr_ptp-v9-0-2d20a2a0f816@linutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="2316153"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:l7yNu/W2LOjwvqFWZQyv4B/WpSA= sha256:o7mLlhM339x6A/gnz8R1NkvxI4rw9YEA9+BnTljd+t4=
	sha1:c580LgybzhmXFG6LlhY7OEuVZ+I= sha256:eGHwgDM3VikZA9080hzyC3BVy5YnsTO6TUp8oC5troU=
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 1085E110138; Wed, 14 Oct 2026 17:46:25 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.149
X-Spam-Status: No, score=-3.149 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.25, 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=linutronix.de header.b=RY6oth6A; dkim=neutral
	reason="invalid (unsupported algorithm ed25519-sha256)"
	header.d=linutronix.de header.b=35yv5MQ+
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 K0gqUTE0XAu8;
	Wed, 14 Oct 2026 17:46:21 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-346321-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linutronix.de
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 7DE03110134; Wed, 14 Oct 2026 17:46:08 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sto.lore.kernel.org (Postfix) with ESMTP id D855A612FAA; Wed, 14 Oct 2026 14:44:37 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E72E54DAE6;
	Wed, 14 Oct 2026 14:44:20 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RY6oth6A";
	dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="35yv5MQ+"
X-Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4C7A54A7D8
	for <netdev@vger.kernel.org>; Wed, 14 Oct 2026 14:44:15 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791989060; cv=none; b=hPKnmitRNt/pqX/5usYAoUkWclCVQYCe3eU4P7pQMInafW5DV8bj7H5diq00dB888UnvsjCDhdcQVIxHMS7LErpCUUM+XWoobsaqA5KO1bnijeQXBgKaSdQdzOl8Qe77WNfV25P88d5+o3EeWFrxIh0Gmgvxci6dyujpO6B12AU=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791989060; c=relaxed/simple;
	bh=mtEx4YAoqGDJGVw9dbkigW2WrkbZLj7Aam0LbmQx8Cs=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version:Content-Type; b=ullYh2B0ajcOah6C0nyGtNA5q2hbbB6Mrr1BSnDYocJs0numljuvbshodIcGL5M0+ZyR7yRHpdj8E7zd20RW4BI7se4BbBuHeWMcGcXzNTWwp1Ot24xS61ztnnxUyQI+d41SSZ39xnEBh6ZMKfvMu6Qb1jwYCb/ksYABpUaajDQ=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RY6oth6A; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=35yv5MQ+; arc=none smtp.client-ip=193.142.43.55
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020; t=1791989049;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=/2OEkdoYAf2F1AJEnJbu54pUpn3/iMbKh4oqbsDrpmU=;
	b=RY6oth6Atbu0jlVMjCvCoV8vHDWT9xThBQICowHaQA1g1EGVhLTT/jA0F5VVYJbtk+/p41
	Tglu+Hqz+0vZKVr6BrqZC7xZQggnV+NGCUqeuVlN7z2p5S9lkNtLO1kEHmHocB+pVVeiKY
	8vEdE+4nc8sM/6JexRQsz1G/ot/Qkf4HS9haZpElUtuWaxp3f9oJPMRJKUq84LufBZCDYA
	2RoLEjd0qRevwCI/odvSeFlYrz7pW/toloGaMpjgDFFVwzjvNLQHA9duZ1vdM9Q/UgQ14B
	NnoqH6w8vreO8luhW50gwGkqk7kJ3K4H9qeY3RG1RJxKb6OjLG5K09/5HkVVsg==
X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020e; t=1791989049;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=/2OEkdoYAf2F1AJEnJbu54pUpn3/iMbKh4oqbsDrpmU=;
	b=35yv5MQ+fb4o2kjU/VeZYKAQMIHvZ4L6XMiseQhvY1onCjFT7fnnwdzTVlDieuld+zO0Hi
	aO8pzrh09XFmpWCQ==
X-Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	"(JC), Jayachandran" <j-rameshbabu@ti.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Chintan Vankar <c-vankar@ti.com>,
	Danish Anwar <danishanwar@ti.com>,
	Daolin Qiu <d-qiu@ti.com>,
	"David S. Miller" <davem@davemloft.net>,
	Felix Maurer <fmaurer@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Neelima Muralidharan <neelima@ti.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Praneeth Bajjuri <praneeth@ti.com>,
	Pratheesh Gangadhar TK <pratheesh@ti.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Simon Horman <horms@kernel.org>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	Daniel Machon <daniel.machon@microchip.com>,
	Eric Dumazet <edumazet@kernel.org>
X-In-Reply-To: <20261014-hsr_ptp-v9-0-2d20a2a0f816@linutronix.de>
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>