cmdmon: fix link-local address check

Don't check for a link-local address on path of a Unix domain socket.

Fixes: 4e747da4b4 ("ntp+cmdmon: fix responding to link-local addresses")
This commit is contained in:
Miroslav Lichvar 2020-10-05 09:58:31 +02:00
parent 6e71e902c8
commit 5d60d611ae

View file

@ -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))