[Git][NTPsec/ntpsec][master] 3 commits: Fix for #709

Hal Murray (@hal.murray) gitlab at mg.gitlab.com
Sun Aug 15 23:29:51 UTC 2021



Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
a8f5a267 by Hal Murray at 2021-08-14T19:25:10-07:00
Fix for #709
  column 3 (time) on sysstats and usestats was broken

- - - - -
9a747226 by Hal Murray at 2021-08-14T19:27:14-07:00
Look in /usr/local/ssl/lib64/ as well as /usr/local/ssl/lib/
  OpenSSL 3.0.0 beta2 gets installed there

- - - - -
cb9d08ca by Hal Murray at 2021-08-14T19:38:21-07:00
Update to beta2
  Install moved from /usr/local/ssl/lib to /usr/local/ssl/lib64

- - - - -


4 changed files:

- HOWTO-OpenSSL
- ntpd/ntp_proto.c
- ntpd/ntp_util.c
- wscript


Changes:

=====================================
HOWTO-OpenSSL
=====================================
@@ -22,10 +22,10 @@ for OpenSSL 1.1.1k
   wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz
   tar -xzf openssl-1.1.1k.tar.gz
   cd openssl-1.1.1k
-for OpenSSL 3.0.0 beta1
-  wget https://www.openssl.org/source/openssl-3.0.0-beta1.tar.gz
-  tar -xzf openssl-3.0.0-beta1.tar.gz
-  cd openssl-3.0.0-beta1
+for OpenSSL 3.0.0 beta2
+  wget https://www.openssl.org/source/openssl-3.0.0-beta2.tar.gz
+  tar -xzf openssl-3.0.0-beta2.tar.gz
+  cd openssl-3.0.0-beta2
 
 # Check NOTES.PERL
 #   for CentOS, you need
@@ -51,7 +51,7 @@ On Linux
 ***                                                                ***
 ***       perl configdata.pm --dump                                ***
 
-time make
+time make -j4
 time make test
 time make build_docs
 sudo make install
@@ -59,7 +59,11 @@ sudo make install
 sudo su
   cd /etc/ld.so.conf.d
   echo "/usr/local/ssl/lib" > openssl-1.1.1k.conf
-  echo "/usr/local/ssl/lib" > openssl-3.0.0-beta.conf
+  ## NB: beta2 changed from lib to lib64
+  ## If you have tested with alpha or beta1,
+  ## you need to fix beta.conf and remove alpha.conf
+  echo "/usr/local/ssl/lib64" > openssl-3.0.0-beta.conf
+  # running ldconfig before install doesn't work
   ldconfig
 
 On FreeBSD, I couldn't figure out how it is supposed to work.


=====================================
ntpd/ntp_proto.c
=====================================
@@ -139,7 +139,6 @@ static int sys_orphwait = NTP_ORPHWAIT; /* orphan wait */
 
 // proto stats structure and variables
 struct statistics_counters {
-	uptime_t	sys_stattime;		/* time since sysstats reset */
 	uint64_t	sys_received;		/* packets received */
 	uint64_t	sys_processed;		/* packets for this host */
 	uint64_t	sys_restricted;		/* restricted packets */
@@ -152,17 +151,18 @@ struct statistics_counters {
 	uint64_t	sys_kodsent;		/* KoD sent */
 };
 volatile struct statistics_counters stat_proto_hourago, stat_proto_total;
+uptime_t	sys_stattime;		/* time since sysstats "reset" */
 
 uptime_t	use_stattime;		/* time since usestats reset */
 
 uptime_t stat_stattime(void)
 {
-  return current_time - stat_proto_hourago.sys_stattime;
+  return current_time - sys_stattime;
 }
 
 uptime_t stat_total_stattime(void)
 {
-  return current_time - stat_proto_total.sys_stattime;
+  return current_time;
 }
 
 #define stat_sys_dumps(member)\
@@ -2781,7 +2781,7 @@ init_proto(const bool verbose)
 #endif
 	get_systime(&dummy);
 	sys_survivors = 0;
-	stat_proto_total.sys_stattime = current_time;
+	sys_stattime = current_time;
 	orphwait = current_time + (unsigned long)sys_orphwait;
 	proto_clr_stats();
 	use_stattime = current_time;
@@ -2904,7 +2904,7 @@ void
 proto_clr_stats(void)
 {
     stat_proto_hourago = stat_proto_total;
-	stat_proto_hourago.sys_stattime = current_time;
+    sys_stattime = current_time;
 }
 
 


=====================================
ntpd/ntp_util.c
=====================================
@@ -637,7 +637,7 @@ record_sys_stats(void)
 		fprintf(sysstats.fp,
 		    "%s %u %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64
 		    " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 "\n",
-			timespec_to_MJDtime(&now), current_time - stat_stattime(),
+			timespec_to_MJDtime(&now), stat_stattime(),
 			stat_received(), stat_processed(), stat_newversion(),
 			stat_oldversion(), stat_restricted(), stat_badlength(),
 			stat_badauth(), stat_declined(), stat_limitrejected(),
@@ -680,7 +680,7 @@ void record_use_stats(void)
 		stimex += usage.ru_stime.tv_sec - oldusage.ru_stime.tv_sec;
 		fprintf(usestats.fp,
 		    "%s %u %.3f %.3f %ld %ld %ld %ld %ld %ld %ld %ld %ld\n",
-		    timespec_to_MJDtime(&now), current_time - stat_use_stattime(),
+		    timespec_to_MJDtime(&now), stat_use_stattime(),
 		    utime, stimex,
 		    usage.ru_minflt -   oldusage.ru_minflt,
 		    usage.ru_majflt -   oldusage.ru_majflt,


=====================================
wscript
=====================================
@@ -519,7 +519,10 @@ int main(int argc, char **argv) {
         # or testing pre-release versions of OpenSSL
         # see HOWTO-OpenSSL
         ctx.env.INCLUDES = ["/usr/local/ssl/include"]
-        ctx.env.LIBPATH = ["/usr/local/ssl/lib"]
+        if os.path.isdir("/usr/local/ssl/lib64/"):
+          ctx.env.LIBPATH = ["/usr/local/ssl/lib64"]
+        else:
+          ctx.env.LIBPATH = ["/usr/local/ssl/lib"]
     elif ctx.env.DEST_OS == "darwin":
         # macports location
         if os.path.isdir("/opt/local/include"):



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/bc270426ba6c48f87edc9837da4c3068cfcc2a8d...cb9d08ca5173933b719043217707d89f4ea1ad3e

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/bc270426ba6c48f87edc9837da4c3068cfcc2a8d...cb9d08ca5173933b719043217707d89f4ea1ad3e
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20210815/fc39ded9/attachment-0001.htm>


More information about the vc mailing list