[Git][NTPsec/ntpsec][master] 3 commits: ifdef out more code with ENABLE_DNS_LOOKUP

Hal Murray gitlab at mg.gitlab.com
Sat Nov 25 07:51:51 UTC 2017


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
ef29e602 by Hal Murray at 2017-11-24T23:50:07-08:00
ifdef out more code with ENABLE_DNS_LOOKUP

- - - - -
b012651f by Hal Murray at 2017-11-24T23:50:07-08:00
Suppress warnings from 32 bit FreeBSD/clang

- - - - -
81bd9f0f by Hal Murray at 2017-11-24T23:50:07-08:00
cleanups

- - - - -


3 changed files:

- ntpd/ntp_proto.c
- tests/ntpd/leapsec.c
- tests/option-tester.sh


Changes:

=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -2416,6 +2416,7 @@ fast_xmit(
 }
 
 
+#ifdef ENABLE_DNS_LOOKUP
 /*
  * dns_take_server - process DNS query for server.
  */
@@ -2560,6 +2561,7 @@ void dns_take_status(struct peer* peer, DNS_Status status) {
 	peer->hpoll = hpoll;
 	peer->nextdate = current_time + (1U << hpoll);
 }
+#endif /* ENABLE_DNS_LOOKUP */
 
 
 


=====================================
tests/ntpd/leapsec.c
=====================================
--- a/tests/ntpd/leapsec.c
+++ b/tests/ntpd/leapsec.c
@@ -577,14 +577,21 @@ TEST(leapsec, addDynamic) {
 	bool           rc;
 	int            idx;
 
+	/* Explicit (time_t) cast avoids warnings
+	 * 32 bit FreeBSD 11.1, Nov 2017
+	 * FreeBSD clang version 4.0.0
+../../tests/ntpd/leapsec.c:582:3: warning: implicit conversion from 'long long' to 'time_t' (aka 'int') changes value from 2982009600 to -1312957696 [-Wconstant-conversion]
+                2982009600,     //      29      # 1 Jul 1994
+                ^~~~~~~~~~
+*/
 	static const time_t insns[] = {
-		2982009600,	//	29	# 1 Jul 1994
-		3029443200,	//	30	# 1 Jan 1996
-		3076704000,	//	31	# 1 Jul 1997
-		3124137600,	//	32	# 1 Jan 1999
-		3345062400,	//	33	# 1 Jan 2006
-		3439756800,	//	34	# 1 Jan 2009
-		3550089600,	//	35	# 1 Jul 2012
+		(time_t)2982009600,	//	29	# 1 Jul 1994
+		(time_t)3029443200,	//	30	# 1 Jan 1996
+		(time_t)3076704000,	//	31	# 1 Jul 1997
+		(time_t)3124137600,	//	32	# 1 Jan 1999
+		(time_t)3345062400,	//	33	# 1 Jan 2006
+		(time_t)3439756800,	//	34	# 1 Jan 2009
+		(time_t)3550089600,	//	35	# 1 Jul 2012
 		0 // sentinel
 	};
 


=====================================
tests/option-tester.sh
=====================================
--- a/tests/option-tester.sh
+++ b/tests/option-tester.sh
@@ -1,4 +1,6 @@
 #!/usr/bin/env bash
+# sh on NetBSD and FreeBSD says:
+#   sh: ${PIPESTATUS[...}: Bad substitution
 
 # This is a hack to build with various configuration options.
 # The intent is to check cases that normal testing doesn't use.
@@ -49,13 +51,17 @@ doit ()
 doit default ""
 doit minimal "--disable-droproot --disable-dns-lookup --disable-kernel-pll --disable-mdns-registration"
 
-if [ `uname -s` = Linux ]
+# This also tests refclocks without DEBUG
+doit classic "--enable-classic-mode --refclock=all"
+
+if [ `uname -s` = "Linux" ]
 then
-doit linux   "--enable-classic-mode --enable-early-droproot --enable-seccomp"
-doit all     "--enable-debug --enable-debug-gdb --enable-debug-timing --refclock=all --enable-lockclock --enable-leap-smear --enable-mssntp --enable-classic-mode --enable-early-droproot --enable-seccomp"
+  # Not supported on CentOS 6
+  LINUX="--enable-seccomp"
 else
-doit all     "--enable-debug --enable-debug-gdb --enable-debug-timing --refclock=all --enable-lockclock --enable-leap-smear --enable-mssntp"
+  LINUX=""
 fi
+doit all     "--enable-debug --enable-debug-gdb --enable-debug-timing --refclock=all --enable-lockclock --enable-leap-smear --enable-mssntp --enable-early-droproot $LINUX"
 
 if [ "`which asciidoc 2>/dev/null`" != "" -a \
      "`which xsltproc 2>/dev/null`" != "" ]
@@ -66,9 +72,11 @@ fi
 # should try cross compile
 
 echo
+echo "PYTHONPATH is" \"$PYTHONPATH\"
 grep VERSION: test*/test.log
 echo
-grep warning: test*/test.log
-grep error:   test*/test.log
-grep ^Trouble test*/test.log
+grep warning:                    test*/test.log
+grep error:                      test*/test.log
+grep "The configuration failed"  test*/test.log
+grep ^Trouble                    test*/test.log
 echo



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/e10654087779db4135435edc8a10508231c9ce14...81bd9f0f05ecb73c8043c5723f22ee5fa8d3b1bb

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/e10654087779db4135435edc8a10508231c9ce14...81bd9f0f05ecb73c8043c5723f22ee5fa8d3b1bb
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/20171125/6fa998b5/attachment.html>


More information about the vc mailing list