New upstream version 2.3.4

This commit is contained in:
Jan Wagner 2023-10-18 07:29:37 +00:00
parent e7bdd1c6c6
commit de72f6f588
556 changed files with 90432 additions and 53391 deletions

View file

@ -86,7 +86,7 @@ typedef struct {
/* NB: not necessarily NULL terminated! */
} ntp_control_message;
/* this is an association/status-word pair found in control packet reponses */
/* this is an association/status-word pair found in control packet responses */
typedef struct {
uint16_t assoc;
uint16_t status;
@ -189,7 +189,7 @@ setup_control_request(ntp_control_message *p, uint8_t opcode, uint16_t seq){
}
/* This function does all the actual work; roughly here's what it does
* beside setting the offest, jitter and stratum passed as argument:
* beside setting the offset, jitter and stratum passed as argument:
* - offset can be negative, so if it cannot get the offset, offset_result
* is set to UNKNOWN, otherwise OK.
* - jitter and stratum are set to -1 if they cannot be retrieved so any
@ -199,7 +199,7 @@ setup_control_request(ntp_control_message *p, uint8_t opcode, uint16_t seq){
* status is pretty much useless as syncsource_found is a global variable
* used later in main to check is the server was synchronized. It works
* so I left it alone */
int ntp_request(const char *host, double *offset, int *offset_result, double *jitter, int *stratum, int *num_truechimers){
int ntp_request(double *offset, int *offset_result, double *jitter, int *stratum, int *num_truechimers){
int conn=-1, i, npeers=0, num_candidates=0;
double tmp_offset = 0;
int min_peer_sel=PEER_INCLUDED;
@ -306,7 +306,7 @@ int ntp_request(const char *host, double *offset, int *offset_result, double *ji
/* Putting the wanted variable names in the request
* cause the server to provide _only_ the requested values.
* thus reducing net traffic, guaranteeing us only a single
* datagram in reply, and making intepretation much simpler
* datagram in reply, and making interpretation much simpler
*/
/* Older servers doesn't know what jitter is, so if we get an
* error on the first pass we redo it with "dispersion" */
@ -585,8 +585,8 @@ int main(int argc, char *argv[]){
/* set socket timeout */
alarm (socket_timeout);
/* This returns either OK or WARNING (See comment preceeding ntp_request) */
result = ntp_request(server_address, &offset, &offset_result, &jitter, &stratum, &num_truechimers);
/* This returns either OK or WARNING (See comment preceding ntp_request) */
result = ntp_request(&offset, &offset_result, &jitter, &stratum, &num_truechimers);
if(offset_result == STATE_UNKNOWN) {
/* if there's no sync peer (this overrides ntp_request output): */