Hi,
when I cross compile Chrony for a 32bit ARM system using Yocto 4.3.1, no NTP
packets are transmitted.
cmsg_type is set to SO_TIMESTAMPING_NEW.
This is rejected by __sock_cmsg_send() in net/core/sock.c and no packet
is transmitted:
4.3.1
-----
clock_gettime64(CLOCK_REALTIME, {tv_sec=1702632790, tv_nsec=105009194}) = 0
sendmsg(5, {msg_name={sa_family=AF_INET, sin_port=htons(123),
sin_addr=inet_addr("172.16.1.2")}, msg_namelen=16, msg_iov=[{iov_base="#\0\6
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., iov_len=48}], msg_iovlen=1,
msg_control=[{cmsg_len=16, cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_NEW, cmsg_data=???}],
msg_controllen=16, msg_flags=0}, 0) = -1 EINVAL (Invalid argument)
When using Yocto 4.2.3, cmsg_type is set to SO_TIMESTAMPING_OLD.
This works fine:
4.2.3
-----
clock_gettime64(CLOCK_REALTIME, {tv_sec=1702632678, tv_nsec=601199243}) = 0
sendmsg(5, {msg_name={sa_family=AF_INET, sin_port=htons(123),
sin_addr=inet_addr("172.16.1.2")}, msg_namelen=16, msg_iov=[{iov_base="#\0\6
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., iov_len=48}], msg_iovlen=1,
msg_control=[{cmsg_len=16, cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_OLD, cmsg_data=???}],
msg_controllen=16, msg_flags=0}, 0) = 48
I think the 4.3.1 behavior is due to 64bit time now being default in Yocto:
arm-poky-linux-gnueabi-gcc -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9
-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
-Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64
--sysroot=/opt/yocto/4.3.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi -O2
-pipe -g -feliminate-unused-debug-types -pthread -c socket.c
which maps SO_TIMESTAMP to SO_TIMESTAMP_NEW.
I am currently using a kernel based on 5.15.100. I haven't tried a newer one yet
but looking at 6.7-rc5, the code in __sock_cmsg_send still doesn't support
SO_TIMESTAMPING_NEW.
Before I dig deeper, I want to check if this is a known issue already?
/Thomas
--
To unsubscribe email [email protected]
with "unsubscribe" in the subject.
For help email [email protected]
with "help" in the subject.
Trouble? Email [email protected].