[Git][NTPsec/ntpsec][master] 11 commits: libisc: remive unused isc_backtrace_getsymbolfromindex()

Gary E. Miller gitlab at mg.gitlab.com
Sat May 27 01:20:04 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
dab91da6 by Gary E. Miller at 2017-05-26T17:13:33-07:00
libisc: remive unused isc_backtrace_getsymbolfromindex()

- - - - -
c824e442 by Gary E. Miller at 2017-05-26T17:20:45-07:00
libisc: mmerge trivial backtrace-emptytbl.c into backtrace.c

Our copy of libisc is hugely different from upstream now.  No point
pretending to any compatibility.

- - - - -
575f2235 by Gary E. Miller at 2017-05-26T17:24:35-07:00
libisc: remove unused errno2result.

- - - - -
6ad300ed by Gary E. Miller at 2017-05-26T17:30:49-07:00
libisc: remive unused #define FATAL_ERROR

- - - - -
6bed237a by Gary E. Miller at 2017-05-26T17:44:36-07:00
libisc: make isc_ioctl() static,

- - - - -
33a1e3af by Gary E. Miller at 2017-05-26T17:57:19-07:00
libisc: remove unused functions.

remove isc_netaddr_masktoprefixlen_bool(),
 isc_netaddr_masktoprefixlen(), isc_netaddr_getzone()

- - - - -
724563ae by Gary E. Miller at 2017-05-26T18:01:41-07:00
libisc: remove unused -isc_net_probe_ipv6pktinfo()

- - - - -
758cff5a by Gary E. Miller at 2017-05-26T18:13:59-07:00
libisc: remove unused initialize_ipv6pktinfo(). Fix headers.

Since NTPsec has it's own copy of isc headers, stop using the
ssytem copies.

- - - - -
21e726e5 by Gary E. Miller at 2017-05-26T18:16:22-07:00
libisc: remove unused try_ipv6pktinfo()

- - - - -
fda00aaa by Gary E. Miller at 2017-05-26T18:18:11-07:00
libisc/net: remove two unused static vars.

- - - - -
d5b424f5 by Gary E. Miller at 2017-05-26T18:18:39-07:00
libisc: use our copies of include/isc, not the system copies.

This has caused problems in the past.

- - - - -


30 changed files:

- include/isc/mem.h
- include/ntp_io.h
- libisc/assertions.c
- − libisc/backtrace-emptytbl.c
- libisc/backtrace.c
- − libisc/errno2result.c
- − libisc/errno2result.h
- libisc/error.c
- libisc/ifiter_getifaddrs.c
- libisc/ifiter_ioctl.c
- libisc/include/isc/assertions.h
- libisc/include/isc/backtrace.h
- libisc/include/isc/error.h
- libisc/include/isc/interfaceiter.h
- libisc/include/isc/list.h
- libisc/include/isc/net.h
- libisc/include/isc/netaddr.h
- libisc/include/isc/result.h
- libisc/include/isc/sockaddr.h
- libisc/include/isc/syslog.h
- libisc/include/isc/types.h
- libisc/include/isc/util.h
- libisc/interfaceiter.c
- libisc/net.c
- libisc/netaddr.c
- libisc/wscript
- libntp/lib_strbuf.c
- libntp/socktoa.c
- ntpd/ntp_config.c
- ntpd/ntp_io.c


Changes:

=====================================
include/isc/mem.h
=====================================
--- a/include/isc/mem.h
+++ b/include/isc/mem.h
@@ -17,8 +17,8 @@
 
 #include <stdio.h>
 
-#include <isc/lang.h>
-#include <isc/types.h>
+#include "isc/lang.h"
+#include "isc/types.h"
 
 #include "ntp_stdlib.h"
 


=====================================
include/ntp_io.h
=====================================
--- a/include/ntp_io.h
+++ b/include/ntp_io.h
@@ -11,7 +11,7 @@
 #include <fcntl.h>
 #include <netinet/in.h>
 
-#include <isc/netaddr.h>
+#include "isc/netaddr.h"
 
 /*
  * NIC rule match types


=====================================
libisc/assertions.c
=====================================
--- a/libisc/assertions.c
+++ b/libisc/assertions.c
@@ -12,9 +12,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <isc/assertions.h>
-#include <isc/backtrace.h>
-#include <isc/result.h>
+#include "isc/assertions.h"
+#include "isc/backtrace.h"
+#include "isc/result.h"
 
 /*
  * The maximum number of stack frames to dump on assertion failure.


=====================================
libisc/backtrace-emptytbl.c deleted
=====================================
--- a/libisc/backtrace-emptytbl.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2009  Internet Systems Consortium, Inc. ("ISC")
- * Copyright 2015 by the NTPsec project contributors
- * SPDX-License-Identifier: ISC
- */
-
-/*! \file */
-
-/*
- * This file defines an empty (default) symbol table used in backtrace.c
- * If the application wants to have a complete symbol table, it should redefine
- * isc__backtrace_symtable with the complete table in some way, and link the
- * version of the library not including this definition
- * (e.g. libisc-nosymbol.a).
- */
-
-#include "config.h"
-#include <stdio.h>
-
-#include <isc/backtrace.h>
-
-const int isc__backtrace_nsymbols = 0;
-const isc_backtrace_symmap_t isc__backtrace_symtable[] = { { NULL, "" } };


=====================================
libisc/backtrace.c
=====================================
--- a/libisc/backtrace.c
+++ b/libisc/backtrace.c
@@ -14,9 +14,20 @@
 #include <execinfo.h>
 #endif
 
-#include <isc/backtrace.h>
-#include <isc/result.h>
-#include <isc/util.h>
+#include "isc/backtrace.h"
+#include "isc/result.h"
+#include "isc/util.h"
+
+/*
+ * Define empty (default) symbol table used in backtrace.c
+ * If the application wants to have a complete symbol table, it should redefine
+ * isc__backtrace_symtable with the complete table in some way, and link the
+ * version of the library not including this definition
+ * (e.g. libisc-nosymbol.a).
+ */
+
+const int isc__backtrace_nsymbols = 0;
+const isc_backtrace_symmap_t isc__backtrace_symtable[] = { { NULL, "" } };
 
 #ifdef ISC_PLATFORM_USEBACKTRACE
 /*
@@ -198,21 +209,6 @@ isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes) {
 }
 #endif
 
-isc_result_t
-isc_backtrace_getsymbolfromindex(int idx, const void **addrp,
-				 const char **symbolp)
-{
-	REQUIRE(addrp != NULL && *addrp == NULL);
-	REQUIRE(symbolp != NULL && *symbolp == NULL);
-
-	if (idx < 0 || idx >= isc__backtrace_nsymbols)
-		return (ISC_R_RANGE);
-
-	*addrp = isc__backtrace_symtable[idx].addr;
-	*symbolp = isc__backtrace_symtable[idx].symbol;
-	return (ISC_R_SUCCESS);
-}
-
 static int
 symtbl_compare(const void *addr, const void *entryarg) {
 	const isc_backtrace_symmap_t *entry = entryarg;


=====================================
libisc/errno2result.c deleted
=====================================
--- a/libisc/errno2result.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2007, 2011, 2012  Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000-2002  Internet Software Consortium.
- * Copyright 2015 by the NTPsec project contributors
- * SPDX-License-Identifier: ISC
- */
-
-/*! \file */
-
-#include "config.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <isc/result.h>
-#include <isc/util.h>
-
-#include "errno2result.h"
-
-/*%
- * Convert a POSIX errno value into an isc_result_t.  The
- * list of supported errno values is not complete; new users
- * of this function should add any expected errors that are
- * not already there.
- */
-isc_result_t
-isc___errno2result(int posixerrno, const char *file, unsigned int line) {
-	char strbuf[BUFSIZ];
-
-	switch (posixerrno) {
-	case ENOTDIR:
-	case ELOOP:
-	case EINVAL:		/* XXX sometimes this is not for files */
-	case ENAMETOOLONG:
-	case EBADF:
-		return (ISC_R_INVALIDFILE);
-	case ENOENT:
-		return (ISC_R_FILENOTFOUND);
-	case EACCES:
-	case EPERM:
-		return (ISC_R_NOPERM);
-	case EEXIST:
-		return (ISC_R_FILEEXISTS);
-	case EIO:
-		return (ISC_R_IOERROR);
-	case ENOMEM:
-		return (ISC_R_NOMEMORY);
-	case ENFILE:
-	case EMFILE:
-		return (ISC_R_TOOMANYOPENFILES);
-	case EPIPE:
-#ifdef ECONNRESET
-	case ECONNRESET:
-#endif
-#ifdef ECONNABORTED
-	case ECONNABORTED:
-#endif
-		return (ISC_R_CONNECTIONRESET);
-#ifdef ENOTCONN
-	case ENOTCONN:
-		return (ISC_R_NOTCONNECTED);
-#endif
-#ifdef ETIMEDOUT
-	case ETIMEDOUT:
-		return (ISC_R_TIMEDOUT);
-#endif
-#ifdef ENOBUFS
-	case ENOBUFS:
-		return (ISC_R_NORESOURCES);
-#endif
-#ifdef EAFNOSUPPORT
-	case EAFNOSUPPORT:
-		return (ISC_R_FAMILYNOSUPPORT);
-#endif
-#ifdef ENETDOWN
-	case ENETDOWN:
-		return (ISC_R_NETDOWN);
-#endif
-#ifdef EHOSTDOWN
-	case EHOSTDOWN:
-		return (ISC_R_HOSTDOWN);
-#endif
-#ifdef ENETUNREACH
-	case ENETUNREACH:
-		return (ISC_R_NETUNREACH);
-#endif
-#ifdef EHOSTUNREACH
-	case EHOSTUNREACH:
-		return (ISC_R_HOSTUNREACH);
-#endif
-#ifdef EADDRINUSE
-	case EADDRINUSE:
-		return (ISC_R_ADDRINUSE);
-#endif
-	case EADDRNOTAVAIL:
-		return (ISC_R_ADDRNOTAVAIL);
-	case ECONNREFUSED:
-		return (ISC_R_CONNREFUSED);
-	default:
-		ISC_IGNORE(strerror_r(posixerrno, strbuf, sizeof(strbuf)));
-		UNEXPECTED_ERROR(file, (int)line, "unable to convert errno "
-				 "to isc_result: %d: %s",
-				 posixerrno, strbuf);
-		/*
-		 * XXXDCL would be nice if perhaps this function could
-		 * return the system's error string, so the caller
-		 * might have something more descriptive than "unexpected
-		 * error" to log with.
-		 */
-		return (ISC_R_UNEXPECTED);
-	}
-}


=====================================
libisc/errno2result.h deleted
=====================================
--- a/libisc/errno2result.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2007, 2011, 2012  Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000, 2001  Internet Software Consortium.
- * Copyright 2015 by the NTPsec project contributors
- * SPDX-License-Identifier: ISC
- */
-
-#ifndef GUARD_UNIX_ERRNO2RESULT_H
-#define GUARD_UNIX_ERRNO2RESULT_H 1
-
-/*! \file */
-
-/* XXXDCL this should be moved to lib/isc/include/isc/errno2result.h. */
-
-#include <errno.h>		/* Provides errno. */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-#define isc__errno2result(x) isc___errno2result(x, __FILE__, __LINE__)
-
-isc_result_t
-isc___errno2result(int posixerrno, const char *file, unsigned int line);
-
-ISC_LANG_ENDDECLS
-
-#endif /* GUARD_UNIX_ERRNO2RESULT_H */


=====================================
libisc/error.c
=====================================
--- a/libisc/error.c
+++ b/libisc/error.c
@@ -12,7 +12,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <isc/error.h>
+#include "isc/error.h"
 
 /*% Default unexpected callback. */
 static void


=====================================
libisc/ifiter_getifaddrs.c
=====================================
--- a/libisc/ifiter_getifaddrs.c
+++ b/libisc/ifiter_getifaddrs.c
@@ -12,7 +12,7 @@
 
 #include <ifaddrs.h>
 
-#include <isc/util.h>	/* for IGNORE */
+#include "isc/util.h"	/* for IGNORE */
 
 /*% Iterator Magic */
 #define IFITER_MAGIC		ISC_MAGIC('I', 'F', 'I', 'G')


=====================================
libisc/ifiter_ioctl.c
=====================================
--- a/libisc/ifiter_ioctl.c
+++ b/libisc/ifiter_ioctl.c
@@ -86,11 +86,10 @@ struct isc_interfaceiter {
 #endif
 #endif
 
-/* Silence a warning when this file is #included */
-int
+static int
 isc_ioctl(int fildes, int req, char *arg);
 
-int
+static int
 isc_ioctl(int fildes, int req, char *arg) {
 	int trys;
 	int ret;


=====================================
libisc/include/isc/assertions.h
=====================================
--- a/libisc/include/isc/assertions.h
+++ b/libisc/include/isc/assertions.h
@@ -11,7 +11,7 @@
 #ifndef GUARD_ISC_ASSERTIONS_H
 #define GUARD_ISC_ASSERTIONS_H 1
 
-#include <isc/lang.h>
+#include "isc/lang.h"
 
 ISC_LANG_BEGINDECLS
 


=====================================
libisc/include/isc/backtrace.h
=====================================
--- a/libisc/include/isc/backtrace.h
+++ b/libisc/include/isc/backtrace.h
@@ -14,9 +14,7 @@
  * backtrace function).  These functions still perform minimal checks and return
  * ISC_R_FAILURE if they detect an error, but the caller should therefore be
  * very careful about the use of these functions, and generally discouraged to
- * use them except in an exit path.  The exception is
- * isc_backtrace_getsymbolfromindex(), which is expected to be used in a
- * non-error-handling context and validates arguments with assertion checks.
+ * use them except in an exit path.
  *
  * Copyright (C) 2009  Internet Systems Consortium, Inc. ("ISC")
  * Copyright 2015 by the NTPsec project contributors
@@ -30,7 +28,7 @@
  ***	Imports
  ***/
 
-#include <isc/types.h>
+#include "isc/types.h"
 
 /***
  *** Types
@@ -40,9 +38,6 @@ struct isc_backtrace_symmap {
 	const char	*symbol;
 };
 
-extern const int isc__backtrace_nsymbols;
-extern const isc_backtrace_symmap_t isc__backtrace_symtable[];
-
 /***
  *** Functions
  ***/
@@ -71,9 +66,6 @@ isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes)
  *\li	#ISC_R_NOTIMPLEMENTED
  */
 
-isc_result_t
-isc_backtrace_getsymbolfromindex(int idx, const void **addrp,
-				 const char **symbolp);
 /*%<
  * Returns the content of the internal symbol table of the given index.
  * On success, *addrsp and *symbolp point to the address and the symbol of


=====================================
libisc/include/isc/error.h
=====================================
--- a/libisc/include/isc/error.h
+++ b/libisc/include/isc/error.h
@@ -12,8 +12,8 @@
 
 #include <stdarg.h>
 
-#include <isc/formatcheck.h>
-#include <isc/lang.h>
+#include "isc/formatcheck.h"
+#include "isc/lang.h"
 
 ISC_LANG_BEGINDECLS
 


=====================================
libisc/include/isc/interfaceiter.h
=====================================
--- a/libisc/include/isc/interfaceiter.h
+++ b/libisc/include/isc/interfaceiter.h
@@ -28,9 +28,9 @@
  *** Imports
  ***/
 
-#include <isc/lang.h>
-#include <isc/netaddr.h>
-#include <isc/types.h>
+#include "isc/lang.h"
+#include "isc/netaddr.h"
+#include "isc/types.h"
 
 /*!
  * \brief Public structure describing a network interface.


=====================================
libisc/include/isc/list.h
=====================================
--- a/libisc/include/isc/list.h
+++ b/libisc/include/isc/list.h
@@ -8,7 +8,7 @@
 #ifndef GUARD_ISC_LIST_H
 #define GUARD_ISC_LIST_H 1
 #include <stdbool.h>
-#include <isc/assertions.h>
+#include "isc/assertions.h"
 
 #ifdef ISC_LIST_CHECKINIT
 #define ISC_LINK_INSIST(x) ISC_INSIST(x)


=====================================
libisc/include/isc/net.h
=====================================
--- a/libisc/include/isc/net.h
+++ b/libisc/include/isc/net.h
@@ -58,8 +58,8 @@
 #include <netinet/in.h>		/* Contractual promise. */
 #include <arpa/inet.h>		/* Contractual promise. */
 
-#include <isc/lang.h>
-#include <isc/types.h>
+#include "isc/lang.h"
+#include "isc/types.h"
 
 /*% IP address. */
 #define ISC__IPADDR(x)	((isc_uint32_t)htonl((isc_uint32_t)(x)))
@@ -113,18 +113,7 @@ bool
 isc_net_probe_ipv6only_bool(void);
 isc_result_t
 isc_net_probe_ipv6only(void);
-/*%<
- * Check if the system's kernel supports the IPV6_V6ONLY socket option.
- *
- * Returns:
- *
- *\li	#ISC_R_SUCCESS		the option is supported for both TCP and UDP.
- *\li	#ISC_R_NOTFOUND		IPv6 itself or the option is not supported.
- *\li	#ISC_R_UNEXPECTED
- */
 
-isc_result_t
-isc_net_probe_ipv6pktinfo(void);
 /*
  * Check if the system's kernel supports the IPV6_(RECV)PKTINFO socket option
  * for UDP sockets.


=====================================
libisc/include/isc/netaddr.h
=====================================
--- a/libisc/include/isc/netaddr.h
+++ b/libisc/include/isc/netaddr.h
@@ -11,9 +11,9 @@
 /*! \file isc/netaddr.h */
 
 #include <stdbool.h>
-#include <isc/lang.h>
-#include <isc/net.h>
-#include <isc/types.h>
+#include "isc/lang.h"
+#include "isc/net.h"
+#include "isc/types.h"
 
 ISC_LANG_BEGINDECLS
 
@@ -30,16 +30,6 @@ bool
 isc_netaddr_eqprefix(const isc_netaddr_t *, const isc_netaddr_t *,
 		     unsigned int) __attribute__((pure));
 /*%<
- * Compare the 'prefixlen' most significant bits of the network
- * addresses 'a' and 'b'.  If 'b''s scope is zero then 'a''s scope is
- * ignored.  Return #true if they are equal, #false if not.
- */
-
-bool
-isc_netaddr_masktoprefixlen_bool(const isc_netaddr_t *s, unsigned int *lenp);
-isc_result_t
-isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp);
-/*%<
  * Convert a netmask in 's' into a prefix length in '*lenp'.
  * The mask should consist of zero or more '1' bits in the most
  * most significant part of the address, followed by '0' bits.
@@ -91,9 +81,6 @@ isc_netaddr_frompath(isc_netaddr_t *netaddr, const char *path);
 void
 isc_netaddr_setzone(isc_netaddr_t *netaddr, uint32_t zone);
 
-uint32_t
-isc_netaddr_getzone(const isc_netaddr_t *netaddr) __attribute__((pure));
-
 void
 isc_netaddr_any(isc_netaddr_t *netaddr);
 /*%<


=====================================
libisc/include/isc/result.h
=====================================
--- a/libisc/include/isc/result.h
+++ b/libisc/include/isc/result.h
@@ -10,8 +10,8 @@
 
 /*! \file isc/result.h */
 
-#include <isc/lang.h>
-#include <isc/types.h>
+#include "isc/lang.h"
+#include "isc/types.h"
 
 #define ISC_R_SUCCESS			0	/*%< success */
 #define ISC_R_NOMEMORY			1	/*%< out of memory */


=====================================
libisc/include/isc/sockaddr.h
=====================================
--- a/libisc/include/isc/sockaddr.h
+++ b/libisc/include/isc/sockaddr.h
@@ -10,9 +10,9 @@
 
 /*! \file isc/sockaddr.h */
 
-#include <isc/lang.h>
-#include <isc/net.h>
-#include <isc/types.h>
+#include "isc/lang.h"
+#include "isc/net.h"
+#include "isc/types.h"
 
 struct isc_sockaddr {
 	union {


=====================================
libisc/include/isc/syslog.h
=====================================
--- a/libisc/include/isc/syslog.h
+++ b/libisc/include/isc/syslog.h
@@ -10,8 +10,8 @@
 
 /*! \file */
 
-#include <isc/lang.h>
-#include <isc/types.h>
+#include "isc/lang.h"
+#include "isc/types.h"
 
 ISC_LANG_BEGINDECLS
 


=====================================
libisc/include/isc/types.h
=====================================
--- a/libisc/include/isc/types.h
+++ b/libisc/include/isc/types.h
@@ -16,7 +16,7 @@
  * XXXDCL This is just for ISC_LIST and ISC_LINK, but gets all of the other
  * list macros too.
  */
-#include <isc/list.h>
+#include "isc/list.h"
 
 /* Core Types.  Alphabetized by defined type. */
 


=====================================
libisc/include/isc/util.h
=====================================
--- a/libisc/include/isc/util.h
+++ b/libisc/include/isc/util.h
@@ -79,12 +79,12 @@
 #define ISC_UTIL_TRACE(a)
 #endif
 
-#include <isc/result.h>		/* Contractual promise. */
+#include "isc/result.h"		/* Contractual promise. */
 
 /*
  * List Macros.
  */
-#include <isc/list.h>		/* Contractual promise. */
+#include "isc/list.h"		/* Contractual promise. */
 
 #define LIST(type)			ISC_LIST(type)
 #define INIT_LIST(type)			ISC_LIST_INIT(type)
@@ -125,8 +125,6 @@
 
 /*% Unexpected Error */
 #define UNEXPECTED_ERROR		isc_error_unexpected
-/*% Fatal Error */
-#define FATAL_ERROR			isc_error_fatal
 /*% Runtime Check */
 #define RUNTIME_CHECK(cond)		ISC_ERROR_RUNTIMECHECK(cond)
 


=====================================
libisc/interfaceiter.c
=====================================
--- a/libisc/interfaceiter.c
+++ b/libisc/interfaceiter.c
@@ -20,13 +20,13 @@
 #include <unistd.h>
 #include <errno.h>
 
-#include <isc/interfaceiter.h>
-#include <isc/magic.h>
-#include <isc/mem.h>
-#include <isc/net.h>
-#include <isc/result.h>
-#include <isc/types.h>
-#include <isc/util.h>
+#include "isc/interfaceiter.h"
+#include "isc/magic.h"
+#include "isc/mem.h"
+#include "isc/net.h"
+#include "isc/result.h"
+#include "isc/types.h"
+#include "isc/util.h"
 
 /* Must follow <isc/net.h>. */
 #ifdef HAVE_NET_IF6_H


=====================================
libisc/net.c
=====================================
--- a/libisc/net.c
+++ b/libisc/net.c
@@ -18,18 +18,16 @@
 #include <unistd.h>
 #include <string.h>
 
-#include <isc/net.h>
-#include <isc/util.h>
+#include "isc/net.h"
+#include "isc/util.h"
 
 static bool 	once_ipv6only = false;
-static bool 	once_ipv6pktinfo = false;
 
 static bool 	once = false;
 
 static isc_result_t	ipv4_result = ISC_R_NOTFOUND;
 static isc_result_t	ipv6_result = ISC_R_NOTFOUND;
 static isc_result_t	ipv6only_result = ISC_R_NOTFOUND;
-static isc_result_t	ipv6pktinfo_result = ISC_R_NOTFOUND;
 
 static isc_result_t
 try_proto(int domain) {
@@ -204,54 +202,6 @@ initialize_ipv6only(void) {
 	try_ipv6only();
 }
 
-static void
-try_ipv6pktinfo(void) {
-	int s, on;
-	char strbuf[BUFSIZ];
-	isc_result_t result;
-	int optname;
-
-	result = isc_net_probeipv6();
-	if (result != ISC_R_SUCCESS) {
-		ipv6pktinfo_result = result;
-		return;
-	}
-
-	/* we only use this for UDP sockets */
-	s = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP);
-	if (s == -1) {
-		ISC_IGNORE(strerror_r(errno, strbuf, sizeof(strbuf)));
-		UNEXPECTED_ERROR(__FILE__, __LINE__,
-				 "socket() failed: %s", strbuf);
-		ipv6pktinfo_result = ISC_R_UNEXPECTED;
-		return;
-	}
-
-#ifdef IPV6_RECVPKTINFO
-	optname = IPV6_RECVPKTINFO;
-#else
-	optname = IPV6_PKTINFO;
-#endif
-	on = 1;
-	if (setsockopt(s, IPPROTO_IPV6, optname, &on, sizeof(on)) < 0) {
-		ipv6pktinfo_result = ISC_R_NOTFOUND;
-		goto close;
-	}
-
-	ipv6pktinfo_result = ISC_R_SUCCESS;
-
-close:
-	close(s);
-	return;
-}
-
-static void
-initialize_ipv6pktinfo(void) {
-	if (once_ipv6pktinfo) return;
-	once_ipv6pktinfo = true;
-	try_ipv6pktinfo();
-}
-
 bool
 isc_net_probe_ipv6only_bool(void) {
     return (ISC_R_SUCCESS == isc_net_probe_ipv6only());
@@ -262,11 +212,3 @@ isc_net_probe_ipv6only(void) {
 	initialize_ipv6only();
 	return (ipv6only_result);
 }
-
-isc_result_t
-isc_net_probe_ipv6pktinfo(void) {
-	initialize_ipv6pktinfo();
-	return (ipv6pktinfo_result);
-}
-
-


=====================================
libisc/netaddr.c
=====================================
--- a/libisc/netaddr.c
+++ b/libisc/netaddr.c
@@ -11,10 +11,10 @@
 
 #include <stdio.h>
 
-#include <isc/net.h>
-#include <isc/netaddr.h>
-#include <isc/sockaddr.h>
-#include <isc/util.h>
+#include "isc/net.h"
+#include "isc/netaddr.h"
+#include "isc/sockaddr.h"
+#include "isc/util.h"
 #include "ntp_stdlib.h"		/* NTP change for strlcpy, strlcat */
 
 #define ISC_TF(x) ((x) ? true : false)
@@ -81,45 +81,6 @@ isc_netaddr_eqprefix(const isc_netaddr_t *a, const isc_netaddr_t *b,
 	return (true);
 }
 
-bool
-isc_netaddr_masktoprefixlen_bool(const isc_netaddr_t *s, unsigned int *lenp) {
-    return (ISC_R_SUCCESS == isc_netaddr_masktoprefixlen(s, lenp));
-}
-isc_result_t
-isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp) {
-	unsigned int nbits = 0, nbytes = 0, ipbytes = 0, i;
-	const unsigned char *p;
-
-	switch (s->family) {
-	case AF_INET:
-		p = (const unsigned char *) &s->type.in;
-		ipbytes = 4;
-		break;
-	case AF_INET6:
-		p = (const unsigned char *) &s->type.in6;
-		ipbytes = 16;
-		break;
-	default:
-		return (ISC_R_NOTIMPLEMENTED);
-	}
-	for (i = 0; i < ipbytes; i++) {
-		if (p[i] != 0xFF)
-			break;
-	}
-	nbytes = i;
-	if (i < ipbytes) {
-		unsigned int c = p[nbytes];
-		while ((c & 0x80) != 0 && nbits < 8) {
-			c <<= 1; nbits++;
-		}
-		if ((c & 0xFF) != 0)
-			return (ISC_R_MASKNONCONTIG);
-		i++;
-	}
-	*lenp = nbytes * 8 + nbits;
-	return (ISC_R_SUCCESS);
-}
-
 void
 isc_netaddr_fromin(isc_netaddr_t *netaddr, const struct in_addr *ina) {
 	memset(netaddr, 0, sizeof(*netaddr));
@@ -142,11 +103,6 @@ isc_netaddr_setzone(isc_netaddr_t *netaddr, uint32_t zone) {
 	netaddr->zone = zone;
 }
 
-uint32_t
-isc_netaddr_getzone(const isc_netaddr_t *netaddr) {
-	return (netaddr->zone);
-}
-
 void
 isc_netaddr_fromsockaddr(isc_netaddr_t *t, const isc_sockaddr_t *s) {
 	int family = s->type.sa.sa_family;


=====================================
libisc/wscript
=====================================
--- a/libisc/wscript
+++ b/libisc/wscript
@@ -3,11 +3,9 @@ def build(ctx):
 
     libisc_source = [
         "assertions.c",
-        "backtrace-emptytbl.c",
         "backtrace.c",
         "error.c",
         "netaddr.c",
-        "errno2result.c",
         "interfaceiter.c",
         "net.c"
     ]


=====================================
libntp/lib_strbuf.c
=====================================
--- a/libntp/lib_strbuf.c
+++ b/libntp/lib_strbuf.c
@@ -3,7 +3,7 @@
  */
 #include "config.h"
 
-#include <isc/net.h>
+#include "isc/net.h"
 
 #include "ntp_fp.h"
 #include "ntp_stdlib.h"


=====================================
libntp/socktoa.c
=====================================
--- a/libntp/socktoa.c
+++ b/libntp/socktoa.c
@@ -10,8 +10,8 @@
 
 #include <stdio.h>
 #include <arpa/inet.h>
-#include <isc/netaddr.h>
-#include <isc/sockaddr.h>
+#include "isc/netaddr.h"
+#include "isc/sockaddr.h"
 
 #include "ntp_fp.h"
 #include "lib_strbuf.h"


=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -22,7 +22,7 @@
 #include <signal.h>
 #include <sys/wait.h>
 
-#include <isc/net.h>
+#include "isc/net.h"
 
 #include "ntp.h"
 #include "ntpd.h"


=====================================
ntpd/ntp_io.c
=====================================
--- a/ntpd/ntp_io.c
+++ b/ntpd/ntp_io.c
@@ -22,10 +22,10 @@
 #include "ntp_dns.h"
 #include "timespecops.h"
 
-#include <isc/mem.h>
-#include <isc/interfaceiter.h>
-#include <isc/netaddr.h>
-#include <isc/sockaddr.h>
+#include "isc/mem.h"
+#include "isc/interfaceiter.h"
+#include "isc/netaddr.h"
+#include "isc/sockaddr.h"
 
 #ifdef HAVE_NET_ROUTE_H
 # define USE_ROUTING_SOCKET



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/4397aba2c1647aabb96c3e18c3dc9f3b00e62364...d5b424f58315dc7babbdec4d7a59416a168a0b0b

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/4397aba2c1647aabb96c3e18c3dc9f3b00e62364...d5b424f58315dc7babbdec4d7a59416a168a0b0b
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/20170527/405d38fd/attachment.html>


More information about the vc mailing list