]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
cmdmon: fix link-local address check
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 5 Oct 2020 07:58:31 +0000 (09:58 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 5 Oct 2020 16:56:37 +0000 (18:56 +0200)
Don't check for a link-local address on path of a Unix domain socket.

Fixes: 4e747da4b482 ("ntp+cmdmon: fix responding to link-local addresses")
cmdmon.c

index a7a6a58f82e90720a9c7717aa874319521b189e9..c17db0cbdee6f4d609650ec1a888293dffb4d062 100644 (file)
--- a/cmdmon.c
+++ b/cmdmon.c
@@ -306,7 +306,8 @@ transmit_reply(int sock_fd, int request_length, SCK_Message *message)
 
   /* Don't require responses to non-link-local addresses to use the same
      interface */
-  if (!SCK_IsLinkLocalIPAddress(&message->remote_addr.ip.ip_addr))
+  if (message->addr_type == SCK_ADDR_IP &&
+      !SCK_IsLinkLocalIPAddress(&message->remote_addr.ip.ip_addr))
     message->if_index = INVALID_IF_INDEX;
 
   if (!SCK_SendMessage(sock_fd, message, 0))