mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 04:45:07 -05:00
nts: include server address in client NTS-KE log messages
This commit is contained in:
@@ -318,6 +318,7 @@ int
|
|||||||
NKC_Start(NKC_Instance inst)
|
NKC_Start(NKC_Instance inst)
|
||||||
{
|
{
|
||||||
IPSockAddr local_addr;
|
IPSockAddr local_addr;
|
||||||
|
char label[512];
|
||||||
int sock_fd;
|
int sock_fd;
|
||||||
|
|
||||||
assert(!NKC_IsActive(inst));
|
assert(!NKC_IsActive(inst));
|
||||||
@@ -338,9 +339,13 @@ NKC_Start(NKC_Instance inst)
|
|||||||
if (sock_fd < 0)
|
if (sock_fd < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/* Make a label containing both the address and name of the server */
|
||||||
|
if (snprintf(label, sizeof (label), "%s (%s)",
|
||||||
|
UTI_IPSockAddrToString(&inst->address), inst->name) >= sizeof (label))
|
||||||
|
;
|
||||||
|
|
||||||
/* Start a NTS-KE session */
|
/* Start a NTS-KE session */
|
||||||
if (!NKSN_StartSession(inst->session, sock_fd, inst->name,
|
if (!NKSN_StartSession(inst->session, sock_fd, label, client_credentials, CLIENT_TIMEOUT)) {
|
||||||
client_credentials, CLIENT_TIMEOUT)) {
|
|
||||||
SCK_CloseSocket(sock_fd);
|
SCK_CloseSocket(sock_fd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user