WSL2-Linux-Kernel/drivers/ptp
Miroslav Lichvar ff53c861e9 net: fix SOF_TIMESTAMPING_BIND_PHC to work with multiple sockets
[ Upstream commit 007747a984 ]

When multiple sockets using the SOF_TIMESTAMPING_BIND_PHC flag received
a packet with a hardware timestamp (e.g. multiple PTP instances in
different PTP domains using the UDPv4/v6 multicast or L2 transport),
the timestamps received on some sockets were corrupted due to repeated
conversion of the same timestamp (by the same or different vclocks).

Fix ptp_convert_timestamp() to not modify the shared skb timestamp
and return the converted timestamp as a ktime_t instead. If the
conversion fails, return 0 to not confuse the application with
timestamps corresponding to an unexpected PHC.

Fixes: d7c0882655 ("net: socket: support hardware timestamp conversion to PHC bound")
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Cc: Yangbo Lu <yangbo.lu@nxp.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 11:03:52 +01:00
..
Kconfig ptp: ocp: add COMMON_CLK dependency 2021-09-20 11:11:54 +01:00
Makefile
idt8a340_reg.h
ptp_chardev.c
ptp_clock.c ptp: free 'vclock_index' in ptp_clock_release() 2021-10-21 12:50:38 +01:00
ptp_clockmatrix.c
ptp_clockmatrix.h
ptp_dte.c
ptp_idt82p33.c
ptp_idt82p33.h
ptp_ines.c
ptp_kvm_arm.c
ptp_kvm_common.c
ptp_kvm_x86.c ptp: fix error print of ptp_kvm on X86_64 platform 2021-10-15 11:19:25 +01:00
ptp_ocp.c ptp: ocp: Fix a couple NULL vs IS_ERR() checks 2021-11-25 09:48:40 +01:00
ptp_pch.c ptp_pch: Load module automatically if ID matches 2021-10-02 16:13:00 +01:00
ptp_private.h
ptp_qoriq.c
ptp_qoriq_debugfs.c
ptp_sysfs.c
ptp_vclock.c net: fix SOF_TIMESTAMPING_BIND_PHC to work with multiple sockets 2022-01-27 11:03:52 +01:00
ptp_vmw.c