From: Harlan Stenn Date: Sun, 15 Oct 2017 04:51:52 +0000 (+0000) Subject: [Bug 3441] Validate the assumption that AF_UNSPEC is 0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53e70f3b15513191bb1fae678179ddb52ef540d2;p=thirdparty%2Fntp.git [Bug 3441] Validate the assumption that AF_UNSPEC is 0 bk: 59e2e968XKGrphyhEOk7m52Oh1txTw --- diff --git a/ChangeLog b/ChangeLog index 468f8645a..0e1f576d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ --- +* [Bug 3441] Validate the assumption that AF_UNSPEC is 0. stenn@ntp.org * [Bug 3439] When running multiple commands / hosts in ntpq... - applied patch by ggarvey * [Bug 3438] Negative values and values > 999 days in... diff --git a/configure.ac b/configure.ac index e0775b1c1..4e7e06af6 100644 --- a/configure.ac +++ b/configure.ac @@ -528,6 +528,8 @@ AC_CHECK_HEADERS([sys/timex.h], [], [], [ #endif ]) +NTP_AF_UNSPEC + AC_TYPE_SIGNAL AC_TYPE_OFF_T AC_STRUCT_TM dnl defines TM_IN_SYS_TIME used by refclock_parse.c diff --git a/sntp/m4/ntp_af_unspec.m4 b/sntp/m4/ntp_af_unspec.m4 new file mode 100644 index 000000000..cdb453d6d --- /dev/null +++ b/sntp/m4/ntp_af_unspec.m4 @@ -0,0 +1,23 @@ +dnl ###################################################################### +dnl AF_UNSPEC checks +AC_DEFUN([NTP_AF_UNSPEC], [ + +# We could do a cv check here, but is it worth it? + +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #ifndef AF_UNSPEC + #include "Bletch: AF_UNSPEC is undefined!" + #endif + #if AF_UNSPEC != 0 + #include "Bletch: AF_UNSPEC != 0" + #endif + ]], + [AC_MSG_NOTICE([AF_UNSPEC is zero, as expected.])], + [AC_MSG_ERROR([AF_UNSPEC is not zero on this platform!])] + )] +)]) + +dnl ######################################################################