Commit 4d56a33a authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

server: Ignore some ICMP-originated socket errors for connectionless sockets.

parent 9d3e458c
...@@ -813,7 +813,7 @@ static void post_sock_messages( struct sock *sock ) ...@@ -813,7 +813,7 @@ static void post_sock_messages( struct sock *sock )
} }
} }
static inline int sock_error( struct sock *sock ) static inline int sock_error( struct sock *sock, int *poll_event )
{ {
int error = 0; int error = 0;
socklen_t len = sizeof(error); socklen_t len = sizeof(error);
...@@ -839,8 +839,14 @@ static inline int sock_error( struct sock *sock ) ...@@ -839,8 +839,14 @@ static inline int sock_error( struct sock *sock )
error = sock->errors[AFD_POLL_BIT_ACCEPT]; error = sock->errors[AFD_POLL_BIT_ACCEPT];
break; break;
case SOCK_CONNECTED:
case SOCK_CONNECTIONLESS: case SOCK_CONNECTIONLESS:
if (error == ENETUNREACH || error == EHOSTUNREACH || error == ECONNRESET)
{
if (poll_event) *poll_event &= ~POLLERR;
return 0;
}
/* fallthrough */
case SOCK_CONNECTED:
if (error == ECONNRESET || error == EPIPE) if (error == ECONNRESET || error == EPIPE)
{ {
sock->reset = 1; sock->reset = 1;
...@@ -1346,7 +1352,7 @@ static void sock_poll_event( struct fd *fd, int event ) ...@@ -1346,7 +1352,7 @@ static void sock_poll_event( struct fd *fd, int event )
fprintf(stderr, "socket %p select event: %x\n", sock, event); fprintf(stderr, "socket %p select event: %x\n", sock, event);
if (event & (POLLERR | POLLHUP)) if (event & (POLLERR | POLLHUP))
error = sock_error( sock ); error = sock_error( sock, &event );
switch (sock->state) switch (sock->state)
{ {
...@@ -3115,7 +3121,7 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) ...@@ -3115,7 +3121,7 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
return; return;
} }
error = sock_error( sock ); error = sock_error( sock, NULL );
if (!error) if (!error)
{ {
for (i = 0; i < ARRAY_SIZE( sock->errors ); ++i) for (i = 0; i < ARRAY_SIZE( sock->errors ); ++i)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment