ntp+cmdmon: fix responding to link-local addresses

After commit e49aececce ("socket: don't set interface for sent
packets") the NTP and cmdmon server stopped responding to requests from
link-local addresses.

Set the interface specifically for packets sent to a link-local address.
This commit is contained in:
Miroslav Lichvar
2020-06-30 16:13:48 +02:00
parent 99e3c67a81
commit 4e747da4b4
4 changed files with 28 additions and 4 deletions

View File

@@ -87,6 +87,9 @@ extern int SCK_IsIpFamilyEnabled(int family);
extern void SCK_GetAnyLocalIPAddress(int family, IPAddr *local_addr);
extern void SCK_GetLoopbackIPAddress(int family, IPAddr *local_addr);
/* Check if an IP address is a link-local address */
extern int SCK_IsLinkLocalIPAddress(IPAddr *addr);
/* Specify a bind()-like function for binding sockets to privileged ports when
running in a restricted process (e.g. after dropping root privileges) */
extern void SCK_SetPrivBind(int (*function)(int sock_fd, struct sockaddr *address,