[ntpsec commit] Remove code guarded by ISC_PLATFORM_HAVESYSUNH -- doesn' t compile...

Eric S. Raymond esr at ntpsec.org
Fri Oct 2 11:25:52 UTC 2015


Module:    ntpsec
Branch:    master
Commit:    f868fd0397094fbbb1a5ed559c38b1bf9b8779d3
Changeset: http://git.ntpsec.org/ntpsec/commit/?id=f868fd0397094fbbb1a5ed559c38b1bf9b8779d3

Author:    Eric S. Raymond <esr at thyrsus.com>
Date:      Fri Oct  2 07:22:27 2015 -0400

Remove code guarded by ISC_PLATFORM_HAVESYSUNH -- doesn't compile...

...and is unused.  Looks like it was written against an ancient version
of the sockets API.

---

 lib/isc/include/isc/sockaddr.h | 17 -----------------
 lib/isc/netaddr.c              | 31 -------------------------------
 lib/isc/sockaddr.c             | 20 --------------------
 lib/isc/win32/libisc.def       |  2 --
 4 files changed, 70 deletions(-)

diff --git a/lib/isc/include/isc/sockaddr.h b/lib/isc/include/isc/sockaddr.h
index e1cf276..392b24f 100644
--- a/lib/isc/include/isc/sockaddr.h
+++ b/lib/isc/include/isc/sockaddr.h
@@ -217,23 +217,6 @@ isc_sockaddr_issitelocal(const isc_sockaddr_t *sa);
  * Returns true if the address is a sitelocal address.
  */
 
-isc_result_t
-isc_sockaddr_frompath(isc_sockaddr_t *sockaddr, const char *path);
-/*
- *  Create a UNIX domain sockaddr that refers to path.
- *
- * Returns:
- * \li	ISC_R_NOSPACE
- * \li	ISC_R_NOTIMPLEMENTED
- * \li	ISC_R_SUCCESS
- */
-
-#define ISC_SOCKADDR_FORMATSIZE \
-	sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX%SSSSSSSSSS#YYYYY")
-/*%<
- * Minimum size of array to pass to isc_sockaddr_format().
- */
-
 ISC_LANG_ENDDECLS
 
 #endif /* GUARD_ISC_SOCKADDR_H */
diff --git a/lib/isc/netaddr.c b/lib/isc/netaddr.c
index e37684d..fa51ff8 100644
--- a/lib/isc/netaddr.c
+++ b/lib/isc/netaddr.c
@@ -50,12 +50,6 @@ isc_netaddr_equal(const isc_netaddr_t *a, const isc_netaddr_t *b) {
 		    a->zone != b->zone)
 			return (false);
 		break;
-#ifdef ISC_PLATFORM_HAVESYSUNH
-	case AF_UNIX:
-		if (strcmp(a->type.un, b->type.un) != 0)
-			return (false);
-		break;
-#endif
 	default:
 		return (false);
 	}
@@ -216,25 +210,6 @@ isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6) {
 	netaddr->type.in6 = *ina6;
 }
 
-isc_result_t
-isc_netaddr_frompath(isc_netaddr_t *netaddr, const char *path) {
-#ifdef ISC_PLATFORM_HAVESYSUNH
-	if (strlen(path) > sizeof(netaddr->type.un) - 1)
-		return (ISC_R_NOSPACE);
-
-        memset(netaddr, 0, sizeof(*netaddr));
-        netaddr->family = AF_UNIX;
-	strlcpy(netaddr->type.un, path, sizeof(netaddr->type.un));
-        netaddr->zone = 0;
-        return (ISC_R_SUCCESS);
-#else 
-	UNUSED(netaddr);
-	UNUSED(path);
-	return (ISC_R_NOTIMPLEMENTED);
-#endif
-}
-
-
 void
 isc_netaddr_setzone(isc_netaddr_t *netaddr, isc_uint32_t zone) {
 	/* we currently only support AF_INET6. */
@@ -265,12 +240,6 @@ isc_netaddr_fromsockaddr(isc_netaddr_t *t, const isc_sockaddr_t *s) {
 		t->zone = 0;
 #endif
 		break;
-#ifdef ISC_PLATFORM_HAVESYSUNH
-	case AF_UNIX:
-		memcpy(t->type.un, s->type.sunix.sun_path, sizeof(t->type.un));
-		t->zone = 0;
-		break;
-#endif
 	default:
 		INSIST(0);
 	}
diff --git a/lib/isc/sockaddr.c b/lib/isc/sockaddr.c
index f8a76ab..f7b8009 100644
--- a/lib/isc/sockaddr.c
+++ b/lib/isc/sockaddr.c
@@ -371,23 +371,3 @@ isc_sockaddr_islinklocal(const isc_sockaddr_t *sockaddr) {
 	return (false);
 }
 
-isc_result_t
-isc_sockaddr_frompath(isc_sockaddr_t *sockaddr, const char *path) {
-#ifdef ISC_PLATFORM_HAVESYSUNH
-	if (strlen(path) >= sizeof(sockaddr->type.sunix.sun_path))
-		return (ISC_R_NOSPACE);
-	memset(sockaddr, 0, sizeof(*sockaddr));
-	sockaddr->length = sizeof(sockaddr->type.sunix);
-	sockaddr->type.sunix.sun_family = AF_UNIX;
-#ifdef ISC_PLATFORM_HAVESALEN
-	sockaddr->type.sunix.sun_len =
-			(unsigned char)sizeof(sockaddr->type.sunix);
-#endif
-	strlcpy(sockaddr->type.sunix.sun_path, path, sizeof(sockaddr->type.sunix.sun_path));
-	return (ISC_R_SUCCESS);
-#else
-	UNUSED(sockaddr);
-	UNUSED(path);
-	return (ISC_R_NOTIMPLEMENTED);
-#endif
-}
diff --git a/lib/isc/win32/libisc.def b/lib/isc/win32/libisc.def
index 7d964fd..129503c 100644
--- a/lib/isc/win32/libisc.def
+++ b/lib/isc/win32/libisc.def
@@ -359,7 +359,6 @@ isc_netaddr_equal
 isc_netaddr_format
 isc_netaddr_fromin
 isc_netaddr_fromin6
-isc_netaddr_frompath
 isc_netaddr_fromsockaddr
 isc_netaddr_fromv4mapped
 isc_netaddr_getzone
@@ -463,7 +462,6 @@ isc_sockaddr_format
 isc_sockaddr_fromin
 isc_sockaddr_fromin6
 isc_sockaddr_fromnetaddr
-isc_sockaddr_frompath
 isc_sockaddr_getport
 isc_sockaddr_hash
 isc_sockaddr_isexperimental



More information about the vc mailing list