From 4ddadd5622b2248784cc171568fdcb709d9980e2 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Thu, 1 Feb 2018 17:24:26 +0100 Subject: [PATCH] ntp: don't request TX timestamp when SW/HW timestamping is disabled --- ntp_io_linux.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ntp_io_linux.c b/ntp_io_linux.c index 00caed0..8edcfcc 100644 --- a/ntp_io_linux.c +++ b/ntp_io_linux.c @@ -682,6 +682,9 @@ NIO_Linux_RequestTxTimestamp(struct msghdr *msg, int cmsglen, int sock_fd) { struct cmsghdr *cmsg; + if (!ts_flags) + return cmsglen; + /* Check if TX timestamping is disabled on this socket */ if (permanent_ts_options || !NIO_IsServerSocket(sock_fd)) return cmsglen;