summaryrefslogtreecommitdiff
path: root/src/basic/fd-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/fd-util.h')
-rw-r--r--src/basic/fd-util.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h
index 2e5616cb7..b2d5b11a9 100644
--- a/src/basic/fd-util.h
+++ b/src/basic/fd-util.h
@@ -84,8 +84,12 @@ int fd_duplicate_data_fd(int fd);
#endif // 0
/* Hint: ENETUNREACH happens if we try to connect to "non-existing" special IP addresses, such as ::5 */
-#define ERRNO_IS_DISCONNECT(r) \
- IN_SET(r, ENOTCONN, ECONNRESET, ECONNREFUSED, ECONNABORTED, EPIPE, ENETUNREACH)
+/* The kernel sends e.g., EHOSTUNREACH or ENONET to userspace in some ICMP error cases.
+ * See the icmp_err_convert[] in net/ipv4/icmp.c in the kernel sources */
+#define ERRNO_IS_DISCONNECT(r) \
+ IN_SET(r, \
+ ENOTCONN, ECONNRESET, ECONNREFUSED, ECONNABORTED, EPIPE, \
+ ENETUNREACH, EHOSTUNREACH, ENOPROTOOPT, EHOSTDOWN, ENONET)
/* Resource exhaustion, could be our fault or general system trouble */
#define ERRNO_IS_RESOURCE(r) \