]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Merge psp-fb1.ntp.org:/home/stenn/ntp-dev
authorHarlan Stenn <stenn@ntp.org>
Fri, 7 Jan 2011 05:30:59 +0000 (00:30 -0500)
committerHarlan Stenn <stenn@ntp.org>
Fri, 7 Jan 2011 05:30:59 +0000 (00:30 -0500)
into  psp-fb1.ntp.org:/a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-libevent

bk: 4d26a513ajj1wp-jlu5Xm48d047aaA

1  2 
sntp/configure.ac
sntp/main.c
sntp/networking.c

Simple merge
diff --cc sntp/main.c
index 21b37e889ccd48b18f98b2eb839d7c0edb2f2c20,7292d377361876b866fecec50ec44d329ae657f4..f8776646675b5d062e53a785e9e6fa2d3f850e35
@@@ -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
index ba29593bd69c91e4d4fa2fbee7aad3dbdf489acb,5d3c6bd39f23ee98a044282e1955b448bcee0957..9c95dff28a01b4983cfc56ed91a089c8a4a3d0ec
@@@ -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;