summaryrefslogtreecommitdiff
path: root/src/basic/fd-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-08 02:33:54 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-11 19:39:59 +0100
commita1a3f73a57da25dbd158ea71607b7d740b101f49 (patch)
treebf1939c4928ca1d1af3e6b6449826de7f60131a8 /src/basic/fd-util.h
parent6a1a5eec43892dee3ff6e208bceb1931c25c782e (diff)
resolved: when we get a TCP connection failure, try again
Previously, when we couldn't connect to a DNS server via TCP we'd abort the whole transaction using a "connection-failure" state. This change removes that, and counts failed connections as "lost packet" events, so that we switch back to the UDP protocol again.
Diffstat (limited to 'src/basic/fd-util.h')
-rw-r--r--src/basic/fd-util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h
index 5ce1592eeb..973413ff42 100644
--- a/src/basic/fd-util.h
+++ b/src/basic/fd-util.h
@@ -73,3 +73,6 @@ int same_fd(int a, int b);
void cmsg_close_all(struct msghdr *mh);
bool fdname_is_valid(const char *s);
+
+#define ERRNO_IS_DISCONNECT(r) \
+ IN_SET(r, ENOTCONN, ECONNRESET, ECONNREFUSED, ECONNABORTED, EPIPE)