🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26525

[PATCH net-next v14 1/8] hsr: Add header_ops::parse_protocol

#26525
From: Sebastian Andrzej Siewior
Date: Thu, 03 Dec 2026 17:44
36 lines
11115 bytes
af_packet uses dev_parse_header_protocol() to assign skb::protocol.
The hsr stack does not assign a callback so the field is assigned to 0.

There is nothing known to be broken because this is missing. Having a
callback assigned makes it possible to use the protocol field later in
the series by packets which originate from the AF_PACKET interface.

The header used by the HSR stack corresponds to the ethernet header for
the "first" part so the protocol member is at the same position.

Use eth_header_parse_protocol() for the hsr_header_ops's parse_protocol
callback.

Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 net/hsr/hsr_device.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index fc512204600cd..59df647d2fd45 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -247,6 +247,7 @@ static netdev_tx_t hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev)
 static const struct header_ops hsr_header_ops = {
 	.create	 = eth_header,
 	.parse	 = eth_header_parse,
+	.parse_protocol = eth_header_parse_protocol,
 };
 
 static struct sk_buff *hsr_init_skb(struct hsr_port *master, int extra)

-- 
2.55.0
Technical Details
Message-ID: <20261203-hsr_ptp-v14-1-1511ffd4c362@linutronix.de>
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!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-376791-linux-kernel-netdev=dewy.ru
References: <20261203-hsr_ptp-v14-0-1511ffd4c362@linutronix.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!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-376791-linux-kernel-netdev=dewy.ru
From: bigeasy@linutronix.de (Sebastian Andrzej Siewior)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v14 1/8] hsr: Add header_ops::parse_protocol
Date: Thu,  3 Dec 2026 18:44:42 +0100
Organization: Usenet Network
Message-ID: <20261203-hsr_ptp-v14-1-1511ffd4c362@linutronix.de>
References: <20261203-hsr_ptp-v14-0-1511ffd4c362@linutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="2556950"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:0Q9yP3Q6aOheENS+ECS5Q0djg28= sha256:X7XpBu5y0iNeRqUMv9I5SqzRYHrxZtuGN9CLtrhD0mo=
	sha1:ZtRG+GCJov99t3ChNn/gYl45VGo= sha256:DPj463LY2ABQgNfGb2DGtZIGrf0649x1K+PxcTAQ9Xc=
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 7E73F1179F5; Thu,  3 Dec 2026 20:45:14 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.399
X-Spam-Status: No, score=-3.399 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.001, 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=linutronix.de header.b=41XVCdbp; dkim=neutral
	reason="invalid (unsupported algorithm ed25519-sha256)"
	header.d=linutronix.de header.b=WCC4muqs
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 IRezKZBp8ZCF;
	Thu,  3 Dec 2026 20:45:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-376791-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 3D8AF1179E9; Thu,  3 Dec 2026 20:44:58 +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 61078601AD0; Thu,  3 Dec 2026 17:44:58 +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=1796319897;
	b=WX9oSn6yBKlUOzSrkU3XcSwnO42HwdRbUbF/LnGdCM49Fi8WxeyZLD7JB3QHTgA90nfC
	 7e8+0FumPsRMyDWw3VDr8Btg2GIjEzVYF5WTJynJgIpvAtQbM01BwvtfapDkN8TruVC/i
	 5/eYiRN6TxAXEAAvOngkCkOm95laFOA9vYFdG0LgdD67IuHTXIsSjmt6Z0bngpBFaOat3
	 dEK0ohGEqLt0ZUzXItCqOqZXXS+tns++/2oEUGUmnALcA3XNuM49ROmFc+r7r+0mqAj/d
	 XHcJo5dj8IFxKrx/WyaXDVRlPIoFEkf7F0vlVwGvAW5mNrTwtQDBWZpBY9CkQtYjmdA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796319897;
	h=X-Original-To:Received:DMARC-Filter:From:DKIM-Signature:
	 DKIM-Signature:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=uwMJLSwQi5QgKmuoaNuJE5cJB35PRmK3VezLpjLxHZQ=;
	b=Mo8VFVT4aJDWubSrbtEUpVleOpQD8mL4Z/NPCUq+EJrFtBgcv+YCYMwA9VlkuxfFGVXX
	 3ZxiPhzlZZNmTafFEMlOTspshX6NChyy4RI3C+BQoJglRmXoKFal9VlBQQU6QLMLYR7BB
	 idgVlNN7QemglTmrV7Vibr1NqEWWttX/XyeTmcUVpuZTcjyZBt7CH7/Z/OvBjCLiVfAyN
	 w40wDSpREEBvRSZIQnJ9VwI09BzTN7ITpPnm4NyzAAPE4jiDs+jzNJ9U6ZYe2IHzxD5no
	 rHEVh7M/gdCKygXg1cY57P32lQfb2UTinlhYjusffSM8lVBEoyFthg015bKT/cYl/MQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=41XVCdbp;
	dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=WCC4muqs;
	dmarc=pass header.from=linutronix.de;
	spf=pass smtp.mailfrom=linutronix.de;
	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 E6100606A33E;
	Thu,  3 Dec 2026 17:44:56 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=41XVCdbp;
	dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=WCC4muqs
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.142.43.55
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796319896;
	b=mn/ZH/Yx7eGGLvz1bs9EZENAZMS2WpAU0MtF9tAPCF1wdbF+tYfuQfkP4AFE2YS/zwcp
	 ncY1Myeea+kVRXeWXEhtAKWwYsTsJAz082+gwAAxJ8UApXEuyYfF68XnI+P+pbscJInjM
	 NXDsvVi36azoDKxZjwJOmoLkJ2ba6ANRDlwoSJM2/hUESHEzGVoyFGjqDDb4P/L/Ie9cd
	 tc3G3CYNIKiJcUMdmHWJnhZu9U1Vwjza9877lpXtiUlknFw8EnTTX1r0DP0TG5yLuIPom
	 9D1Gn2nN8IXffKoNR0aTfVdwvt+UNGT2ozYKpcNlr5JgA3kz8GINVCCxbJLItQa+R4Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796319896;
	h=DMARC-Filter:From:DKIM-Signature:DKIM-Signature:To:Cc:Subject:Date:
	 Message-ID:In-Reply-To:References:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=uwMJLSwQi5QgKmuoaNuJE5cJB35PRmK3VezLpjLxHZQ=;
	b=gGz06nNhBPeIPAn8/OLxIjeDxeFKRjxqqMZqdUibK7stu2aqS8lUU50viALcy1lOBeQ5
	 uw2D3l7REQSg3+MfHHTiFFdCFicxQ/IPGt6dT0HcyyqmocR/coWjqHfqbUv80ajxi7MvD
	 VCrWa6QO6tSzRSQOUomPX3gphO03cYtvtFTmojwa8EhcsGvKFbG08eH8AOIvvpBgY0SaQ
	 J72DcGMkP43QkWbu/uUFCjKcffSFIiuHmB4zJP786qomqLy2ETzR90NcFkO7bOzYWluud
	 k5KHZFjk9B18xQDGKy0RxuvK6nG+ujv+agfUTQM+hLLGpg6c3081wsxPSoksv0cVpkA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linutronix.de;
	spf=pass smtp.mailfrom=linutronix.de;
	dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=41XVCdbp;
	dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=WCC4muqs;
	arc=none smtp.remote-ip=193.142.43.55
X-Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99208606A32D
	for <netdev@vger.kernel.org>; Thu,  3 Dec 2026 17:44:55 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 99208606A32D
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=1796319893;
	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=uwMJLSwQi5QgKmuoaNuJE5cJB35PRmK3VezLpjLxHZQ=;
	b=41XVCdbpJTGQcD7q1TaEGa0vcAJE/EfR2rbiKH/7dKFlbnpPHeem3C6Fl9SlgZ4jS8U+2e
	FLRjhebOqlpmPbQzfY0BC4wfwZRniIaRTNXOlmr2kSkj/Cnkf5i93c3CErrHVtuoxMyw9k
	iPj7GFYGjmATH7m79LepwIknPJTR/H8nj1rTjo0bjUztSx2/WIy9lS6ue5wmosF6iO4a3w
	D9XkBGMcJJp4/3lm5ri3WpQdPAickGPUS1a2k1N0QZIEjW/0xfOhPtddinMSAkKVtQrqRJ
	Q4B++aIDN1AaRfS/9+Kvwj0oiDhAptMp9ZQzcJZqx1Ysw4Q+68Z0aVKt4JS8ig==
X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020e; t=1796319893;
	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=uwMJLSwQi5QgKmuoaNuJE5cJB35PRmK3VezLpjLxHZQ=;
	b=WCC4muqs+4o3VpMAbREVf+ASsf8aPWSNZeu+gnf88KtsFA8SGc40NnhE6nY5j3+vmlIF7g
	KXp0D3i3uKgj3mCg==
X-Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	"(JC), Jayachandran" <j-rameshbabu@ti.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	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: <20261203-hsr_ptp-v14-0-1511ffd4c362@linutronix.de>
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