summaryrefslogtreecommitdiffstats
path: root/usr.bin/dig/lib/isc/unix
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/dig/lib/isc/unix')
-rw-r--r--usr.bin/dig/lib/isc/unix/errno2result.c26
-rw-r--r--usr.bin/dig/lib/isc/unix/include/isc/net.h15
-rw-r--r--usr.bin/dig/lib/isc/unix/socket.c10
3 files changed, 2 insertions, 49 deletions
diff --git a/usr.bin/dig/lib/isc/unix/errno2result.c b/usr.bin/dig/lib/isc/unix/errno2result.c
index 4430910a346..05ffbdf770d 100644
--- a/usr.bin/dig/lib/isc/unix/errno2result.c
+++ b/usr.bin/dig/lib/isc/unix/errno2result.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: errno2result.c,v 1.1 2020/02/07 09:58:54 florian Exp $ */
+/* $Id: errno2result.c,v 1.2 2020/02/11 17:22:31 florian Exp $ */
/*! \file */
@@ -59,54 +59,30 @@ isc___errno2result(int posixerrno, isc_boolean_t dolog,
case ENFILE:
case EMFILE:
return (ISC_R_TOOMANYOPENFILES);
-#ifdef EOVERFLOW
case EOVERFLOW:
return (ISC_R_RANGE);
-#endif
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:
diff --git a/usr.bin/dig/lib/isc/unix/include/isc/net.h b/usr.bin/dig/lib/isc/unix/include/isc/net.h
index b8e1d8c6478..247af2cadfb 100644
--- a/usr.bin/dig/lib/isc/unix/include/isc/net.h
+++ b/usr.bin/dig/lib/isc/unix/include/isc/net.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: net.h,v 1.1 2020/02/07 09:58:54 florian Exp $ */
+/* $Id: net.h,v 1.2 2020/02/11 17:22:31 florian Exp $ */
#ifndef ISC_NET_H
#define ISC_NET_H 1
@@ -84,19 +84,6 @@
#include <isc/lang.h>
#include <isc/types.h>
-#ifndef IN6_IS_ADDR_SITELOCAL
-/*% is IPv6 address sitelocal? */
-#define IN6_IS_ADDR_SITELOCAL(a) \
- (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
-#endif
-
-
-#ifndef IN6_IS_ADDR_LOOPBACK
-/*% is IPv6 address loopback? */
-#define IN6_IS_ADDR_LOOPBACK(x) \
- (memcmp((x)->s6_addr, in6addr_loopback.s6_addr, 16) == 0)
-#endif
-
/*% IP address. */
#define ISC__IPADDR(x) ((uint32_t)htonl((uint32_t)(x)))
diff --git a/usr.bin/dig/lib/isc/unix/socket.c b/usr.bin/dig/lib/isc/unix/socket.c
index a115ed1492f..0bed76156bd 100644
--- a/usr.bin/dig/lib/isc/unix/socket.c
+++ b/usr.bin/dig/lib/isc/unix/socket.c
@@ -992,16 +992,12 @@ doio_recv(isc__socket_t *sock, isc_socketevent_t *dev) {
SOFT_OR_HARD(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL);
ALWAYS_HARD(ENOBUFS, ISC_R_NORESOURCES);
/* Should never get this one but it was seen. */
-#ifdef ENOPROTOOPT
SOFT_OR_HARD(ENOPROTOOPT, ISC_R_HOSTUNREACH);
-#endif
/*
* HPUX returns EPROTO and EINVAL on receiving some ICMP/ICMPv6
* errors.
*/
-#ifdef EPROTO
SOFT_OR_HARD(EPROTO, ISC_R_HOSTUNREACH);
-#endif
SOFT_OR_HARD(EINVAL, ISC_R_HOSTUNREACH);
#undef SOFT_OR_HARD
@@ -1153,9 +1149,7 @@ doio_send(isc__socket_t *sock, isc_socketevent_t *dev) {
ALWAYS_HARD(EAFNOSUPPORT, ISC_R_ADDRNOTAVAIL);
ALWAYS_HARD(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL);
ALWAYS_HARD(EHOSTUNREACH, ISC_R_HOSTUNREACH);
-#ifdef EHOSTDOWN
ALWAYS_HARD(EHOSTDOWN, ISC_R_HOSTUNREACH);
-#endif
ALWAYS_HARD(ENETUNREACH, ISC_R_NETUNREACH);
ALWAYS_HARD(ENOBUFS, ISC_R_NORESOURCES);
ALWAYS_HARD(EPERM, ISC_R_HOSTUNREACH);
@@ -2434,9 +2428,7 @@ isc__socket_connect(isc_socket_t *sock0, isc_sockaddr_t *addr,
ERROR_MATCH(EAFNOSUPPORT, ISC_R_ADDRNOTAVAIL);
ERROR_MATCH(ECONNREFUSED, ISC_R_CONNREFUSED);
ERROR_MATCH(EHOSTUNREACH, ISC_R_HOSTUNREACH);
-#ifdef EHOSTDOWN
ERROR_MATCH(EHOSTDOWN, ISC_R_HOSTUNREACH);
-#endif
ERROR_MATCH(ENETUNREACH, ISC_R_NETUNREACH);
ERROR_MATCH(ENOBUFS, ISC_R_NORESOURCES);
ERROR_MATCH(EPERM, ISC_R_HOSTUNREACH);
@@ -2574,9 +2566,7 @@ internal_connect(isc_task_t *me, isc_event_t *ev) {
ERROR_MATCH(EAFNOSUPPORT, ISC_R_ADDRNOTAVAIL);
ERROR_MATCH(ECONNREFUSED, ISC_R_CONNREFUSED);
ERROR_MATCH(EHOSTUNREACH, ISC_R_HOSTUNREACH);
-#ifdef EHOSTDOWN
ERROR_MATCH(EHOSTDOWN, ISC_R_HOSTUNREACH);
-#endif
ERROR_MATCH(ENETUNREACH, ISC_R_NETUNREACH);
ERROR_MATCH(ENOBUFS, ISC_R_NORESOURCES);
ERROR_MATCH(EPERM, ISC_R_HOSTUNREACH);