mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 17:05:07 -05:00
cmdmon: allow binding to address that doesn't exist yet
This commit is contained in:
8
cmdmon.c
8
cmdmon.c
@@ -199,6 +199,14 @@ prepare_socket(int family, int port_number)
|
|||||||
LOG(LOGS_ERR, LOGF_CmdMon, "Could not set reuseaddr socket options");
|
LOG(LOGS_ERR, LOGF_CmdMon, "Could not set reuseaddr socket options");
|
||||||
/* Don't quit - we might survive anyway */
|
/* Don't quit - we might survive anyway */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef IP_FREEBIND
|
||||||
|
/* Allow binding to address that doesn't exist yet */
|
||||||
|
if (setsockopt(sock_fd, IPPROTO_IP, IP_FREEBIND, (char *)&on_off, sizeof(on_off)) < 0) {
|
||||||
|
LOG(LOGS_ERR, LOGF_CmdMon, "Could not set free bind socket option");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
if (family == AF_INET6) {
|
if (family == AF_INET6) {
|
||||||
#ifdef IPV6_V6ONLY
|
#ifdef IPV6_V6ONLY
|
||||||
|
|||||||
Reference in New Issue
Block a user