[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250305140352.1624543-1-kory.maincent@bootlin.com>
Date: Wed, 5 Mar 2025 15:03:52 +0100
From: Kory Maincent <kory.maincent@...tlin.com>
To: Kory Maincent <kory.maincent@...tlin.com>,
"David S. Miller" <davem@...emloft.net>,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: thomas.petazzoni@...tlin.com,
Andrew Lunn <andrew@...n.ch>,
Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>
Subject: [PATCH net] net: ethtool: tsinfo: Fix dump command
Fix missing initialization of ts_info->phc_index in the dump command,
which could cause a netdev interface to incorrectly display a PTP provider
at index 0 instead of "none".
Fix it by initializing the phc_index to -1.
In the same time, restore missing initialization of ts_info.cmd for the
IOCTL case, as it was before the transition from ethnl_default_dumpit to
custom ethnl_tsinfo_dumpit.
Fixes: b9e3f7dc9ed95 ("net: ethtool: tsinfo: Enhance tsinfo to support several hwtstamp by net topology")
Signed-off-by: Kory Maincent <kory.maincent@...tlin.com>
---
net/ethtool/tsinfo.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ethtool/tsinfo.c b/net/ethtool/tsinfo.c
index 691be6c445b38..9edc5dc30de88 100644
--- a/net/ethtool/tsinfo.c
+++ b/net/ethtool/tsinfo.c
@@ -291,6 +291,8 @@ static void *ethnl_tsinfo_prepare_dump(struct sk_buff *skb,
memset(reply_data, 0, sizeof(*reply_data));
reply_data->base.dev = dev;
memset(&reply_data->ts_info, 0, sizeof(reply_data->ts_info));
+ reply_data->ts_info.cmd = ETHTOOL_GET_TS_INFO;
+ reply_data->ts_info.phc_index = -1;
return ehdr;
}
--
2.34.1
Powered by blists - more mailing lists