mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
conf: add directives to specify interfaces for binding sockets
Add binddevice, bindacqdevice, and bindcmddevice directive to specify the interface for binding the NTP server, NTP client, and command socket respectively.
This commit is contained in:
6
cmdmon.c
6
cmdmon.c
@@ -157,8 +157,8 @@ static void read_from_cmd_socket(int sock_fd, int event, void *anything);
|
||||
static int
|
||||
open_socket(int family)
|
||||
{
|
||||
const char *local_path, *iface;
|
||||
IPSockAddr local_addr;
|
||||
const char *local_path;
|
||||
int sock_fd, port;
|
||||
|
||||
switch (family) {
|
||||
@@ -173,7 +173,9 @@ open_socket(int family)
|
||||
SCK_GetLoopbackIPAddress(family, &local_addr.ip_addr);
|
||||
local_addr.port = port;
|
||||
|
||||
sock_fd = SCK_OpenUdpSocket(NULL, &local_addr, NULL, SCK_FLAG_RX_DEST_ADDR);
|
||||
iface = CNF_GetBindCommandInterface();
|
||||
|
||||
sock_fd = SCK_OpenUdpSocket(NULL, &local_addr, iface, SCK_FLAG_RX_DEST_ADDR);
|
||||
if (sock_fd < 0) {
|
||||
LOG(LOGS_ERR, "Could not open command socket on %s",
|
||||
UTI_IPSockAddrToString(&local_addr));
|
||||
|
||||
Reference in New Issue
Block a user