]> git.ipfire.org Git - thirdparty/chrony.git/commit
refclock_phc: open device for writing with extpps option master
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 7 Aug 2025 12:04:22 +0000 (14:04 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 7 Aug 2025 12:43:37 +0000 (14:43 +0200)
commitf78e4681eff71d941fab3be5ee406d920a155a20
treea1ceb53b4ca5f02d6453ca927d829df35d2d545a
parentb365edb48edad9f783ef5a05836fbaa53c1063f8
refclock_phc: open device for writing with extpps option

In version 6.15 the Linux kernel started checking write access on the
PHC file descriptor in the PTP_PIN_SETFUNC and PTP_EXTTS_REQUEST ioctls.
chronyd opened the PHC device as readonly, which caused the PHC refclock
driver configured with the extpps option to fail with the
"Could not enable external PHC timestamping" error message.

To ensure compatibility with new kernel versions, add flags to the
SYS_Linux_OpenPHC() function and open the device with the O_RDWR flag
when the extpps option is enabled.
ntp_io_linux.c
refclock_phc.c
sys_linux.c
sys_linux.h