From: Harlan Stenn Date: Fri, 7 Jan 2011 05:30:59 +0000 (-0500) Subject: Merge psp-fb1.ntp.org:/home/stenn/ntp-dev X-Git-Tag: NTP_4_2_7P131~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6be41c4129f64bd03b66d1cc94722cce0d437c7d;p=thirdparty%2Fntp.git Merge psp-fb1.ntp.org:/home/stenn/ntp-dev into psp-fb1.ntp.org:/a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-libevent bk: 4d26a513ajj1wp-jlu5Xm48d047aaA --- 6be41c4129f64bd03b66d1cc94722cce0d437c7d diff --cc sntp/main.c index 21b37e889,7292d3773..f87766466 --- a/sntp/main.c +++ b/sntp/main.c @@@ -407,8 -204,13 +407,13 @@@ handle_pkt char addr_buf[INET6_ADDRSTRLEN]; char *p_SNTP_PRETEND_TIME; time_t pretend_time; + #if SIZEOF_TIME_T == 8 + longlong ll; + #else + long l; + #endif - if(rpktl > 0) + if (rpktl > 0) sw_case = 1; else sw_case = rpktl; @@@ -583,14 -383,16 +593,15 @@@ on_wire struct pkt x_pkt; int error, rpktl, handle_pkt_res; - if (ENABLED_OPT(AUTHENTICATION)) { - key_id = (int) OPT_ARG(AUTHENTICATION); - + if (ENABLED_OPT(AUTHENTICATION) && + atoint(OPT_ARG(AUTHENTICATION), &l)) { + key_id = l; get_key(key_id, &pkt_key); } - for (try=0; try<5; try++) { + for (try = 0; try < 5; try++) { memset(&r_pkt, 0, sizeof rbuf); - + - error = GETTIMEOFDAY(&tv_xmt, (struct timezone *)NULL); + error = GETTIMEOFDAY(&tv_xmt, NULL); tv_xmt.tv_sec += JAN_1970; #ifdef DEBUG diff --cc sntp/networking.c index ba29593bd,5d3c6bd39..9c95dff28 --- a/sntp/networking.c +++ b/sntp/networking.c @@@ -4,27 -4,19 +4,27 @@@ char adr_buf[INET6_ADDRSTRLEN]; -/* resolve_hosts consumes an array of hostnames/addresses and its length, stores a pointer - * to the array with the resolved hosts in res and returns the size of the array res. - * pref_family enforces IPv4 or IPv6 depending on commandline options and system - * capability. If pref_family is NULL or PF_UNSPEC any compatible family will be accepted. - * Check here: Probably getaddrinfo() can do without ISC's IPv6 availability check? - */ +/* +** resolve_hosts consumes an array of hostnames/addresses and its length, +** stores a pointer to the array with the resolved hosts in res and returns +** the size of the array res. +** +** pref_family enforces IPv4 or IPv6 depending on commandline options and +** system capability. +** +** If pref_family is NULL or PF_UNSPEC any compatible family will be +** accepted. +** +** Check here: Probably getaddrinfo() can do without ISC's IPv6 availability +** check? +*/ int resolve_hosts ( - const char **hosts, - int hostc, - struct addrinfo ***res, - int pref_family - ) - const char * const * hosts, - int hostc, - struct addrinfo *** res, - int pref_family - ) ++ const char * const * hosts, ++ int hostc, ++ struct addrinfo *** res, ++ int pref_family ++ ) { register unsigned int a; unsigned int resc;