From 5d60d611ae63590cfafd6aa0e0501a24171f396c Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 5 Oct 2020 09:58:31 +0200 Subject: [PATCH] cmdmon: fix link-local address check 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmdmon.c b/cmdmon.c index a7a6a58..c17db0c 100644 --- 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))