selftests/net: timestamping: Fix bind_phc check
Subsystems (4)
PATCH 1/1 selftests/net: timestamping: Fix bind_phc check
From: Gerhard Engleder <[email protected]>
timestamping checks socket options during initialisation. For the field bind_phc of the socket option SO_TIMESTAMPING it expects the value -1 if PHC is not bound. Actually the value of bind_phc is 0 if PHC is not bound. This results in the following output:
SIOCSHWTSTAMP: tx_type 0 requested, got 0; rx_filter 0 requested, got 0 SO_TIMESTAMP 0SO_TIMESTAMPNS 0SO_TIMESTAMPING flags 0, bind phc 0
not expected, flags 0, bind phc -1
This is fixed by setting default value and expected value of bind_phc to 0.
--- tools/testing/selftests/net/timestamping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/net/timestamping.c +2 -2
@@ -325,8 +325,8 @@ int main(int argc, char **argv)struct ifreq device;struct ifreq hwtstamp;struct hwtstamp_config hwconfig, hwconfig_requested; -struct so_timestamping so_timestamping_get = {0 ,-1 }; -struct so_timestamping so_timestamping = {0 ,-1 }; +struct so_timestamping so_timestamping_get = {0 ,0 }; +struct so_timestamping so_timestamping = {0 ,0 };struct sockaddr_in addr;struct ip_mreq imr;struct in_addr iaddr;
Signature · 1 line
2.20.1
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Quoted 8 lines · On Sun, 30 Jan 2022 10:54:22 +0100 you wrote:
From: Gerhard Engleder <[email protected]>
timestamping checks socket options during initialisation. For the field
bind_phcof the socket optionSO_TIMESTAMPINGit expects the value -1 if PHC is not bound. Actually the value ofbind_phcis 0 if PHC is not bound. This results in the following output:[...]
Here is the summary with links:
- [net-next] selftests/net: timestamping: Fix bind_phc check
https://git.kernel.org/netdev/net-next/c/678dfd528034
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html