summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2015-09-12 14:08:17 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-09-12 14:09:28 +0200
commit51f60c38c8d3cae7b0d75ba51eab5af47f6b5df7 (patch)
treef2daded5563b001e61588c3cb48c230d0a6967d4
parentc6d8af579cffa9662ed1ea9e6096cccec821c6a1 (diff)
Turn EADDRNOTAVAIL to more commonly-understood ECONNREFUSED
Thanks Svante Signell for the investigation. * pflocal/socket.c (S_socket_connect, S_socket_send): When addr_get_sock returns EADDRNOTAVAIL, translate into ECONNREFUSED.
-rw-r--r--pflocal/socket.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/pflocal/socket.c b/pflocal/socket.c
index 792c6379..58449047 100644
--- a/pflocal/socket.c
+++ b/pflocal/socket.c
@@ -92,7 +92,10 @@ S_socket_connect (struct sock_user *user, struct addr *addr)
return EOPNOTSUPP;
err = addr_get_sock (addr, &peer);
- if (!err)
+ if (err == EADDRNOTAVAIL)
+ /* The server went away. */
+ err = ECONNREFUSED;
+ else if (!err)
{
struct sock *sock = user->sock;
struct connq *cq = peer->listen_queue;
@@ -295,6 +298,9 @@ S_socket_send (struct sock_user *user, struct addr *dest_addr, int flags,
if (dest_addr)
{
err = addr_get_sock (dest_addr, &dest_sock);
+ if (err == EADDRNOTAVAIL)
+ /* The server went away. */
+ err = ECONNREFUSED;
if (err)
return err;
if (sock->pipe_class != dest_sock->pipe_class)