From: Roy Marples Date: Tue, 15 Jul 2008 19:16:58 +0000 (+0000) Subject: Close socket on error and signal so that they get refreshed. X-Git-Tag: v4.0.2~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19a81c6a2bb065590be03705d75512fd86749589;p=thirdparty%2Fdhcpcd.git Close socket on error and signal so that they get refreshed. --- diff --git a/client.c b/client.c index 42b4ecfb..5458aac7 100644 --- a/client.c +++ b/client.c @@ -791,6 +791,7 @@ wait_again: while (--nfds > 0) { if (fds[nfds].revents & POLLERR) { logger(LOG_ERR, "error on fd %d", fds[nfds].fd); + do_socket(state, SOCKET_CLOSED); switch (state->state) { case STATE_INIT: /* FALLTHROUGH */ case STATE_DISCOVERING: /* FALLTHROUGH */ @@ -839,6 +840,7 @@ handle_signal(int sig, struct if_state *state, const struct options *options) return 0; } + do_socket(state, SOCKET_CLOSED); switch (state->state) { case STATE_INIT: case STATE_PROBING: