[PATCH 23.11] examples/ptpclient: fix message parsing
Xueming Li
xuemingl at nvidia.com
Sat Apr 5 09:38:29 CEST 2025
Thanks, patch queued to 23.11.4 release staging
Regards,
Xueming
________________________________
From: Stephen Hemminger <stephen at networkplumber.org>
Sent: Thursday, February 20, 2025 1:16 AM
To: stable at dpdk.org <stable at dpdk.org>
Cc: Stephen Hemminger <stephen at networkplumber.org>
Subject: [PATCH 23.11] examples/ptpclient: fix message parsing
[ upstream commit 19630bd0d735badb06143086d4f1c50d726b7bad ]
Calling memcmp on same structure will always be true.
Replace with same conditional used elsewhere.
Link: https://pvs-studio.com/en/blog/posts/cpp/1183/
Fixes: ab129e9065a5 ("examples/ptpclient: add minimal PTP client")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
examples/ptpclient/ptpclient.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index cdf2da64df..92b54f240e 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -365,7 +365,7 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx)
ptp_data->ptpset = 1;
}
- if (memcmp(&ptp_hdr->source_port_id.clock_id,
+ if (memcmp(&ptp_hdr->master_clock_id,
&ptp_hdr->source_port_id.clock_id,
sizeof(struct clock_id)) == 0) {
--
2.47.2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/stable/attachments/20250405/f1fe0952/attachment.htm>
More information about the stable
mailing list