mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-05-28 04:35:40 -04:00
check_ntp(_time): don't die on connect errors
connect errors may happen if clients check agains dual stacked ipv4/6 ntp servers.
This commit is contained in:
parent
24772e755e
commit
6fde27e478
2 changed files with 10 additions and 2 deletions
|
|
@ -398,7 +398,11 @@ double offset_request(const char *host, int *status){
|
|||
die(STATE_UNKNOWN, "can not create new socket");
|
||||
}
|
||||
if(connect(socklist[i], ai_tmp->ai_addr, ai_tmp->ai_addrlen)){
|
||||
die(STATE_UNKNOWN, "can't create socket connection");
|
||||
/* don't die here, because it is enough if there is one server
|
||||
answering in time. This also would break for dual ipv4/6 stacked
|
||||
ntp servers when the client only supports on of them.
|
||||
*/
|
||||
DBG(printf("can't create socket connection on peer %i: %s\n", i, strerror(errno)));
|
||||
} else {
|
||||
ufds[i].fd=socklist[i];
|
||||
ufds[i].events=POLLIN;
|
||||
|
|
|
|||
|
|
@ -344,7 +344,11 @@ double offset_request(const char *host, int *status){
|
|||
die(STATE_UNKNOWN, "can not create new socket");
|
||||
}
|
||||
if(connect(socklist[i], ai_tmp->ai_addr, ai_tmp->ai_addrlen)){
|
||||
die(STATE_UNKNOWN, "can't create socket connection");
|
||||
/* don't die here, because it is enough if there is one server
|
||||
answering in time. This also would break for dual ipv4/6 stacked
|
||||
ntp servers when the client only supports on of them.
|
||||
*/
|
||||
DBG(printf("can't create socket connection on peer %i: %s\n", i, strerror(errno)));
|
||||
} else {
|
||||
ufds[i].fd=socklist[i];
|
||||
ufds[i].events=POLLIN;
|
||||
|
|
|
|||
Loading…
Reference in a new issue