Check for failure in creating listen sockets in change_listen_mode().

This commit is contained in:
Nicholas J. Kain 2010-11-13 12:34:22 -05:00
parent faa56bb616
commit 75206dce13

View File

@ -122,6 +122,12 @@ static void change_listen_mode(int new_mode)
fd = listen_socket(INADDR_ANY, CLIENT_PORT, client_config.interface); fd = listen_socket(INADDR_ANY, CLIENT_PORT, client_config.interface);
else if (new_mode == LISTEN_RAW) else if (new_mode == LISTEN_RAW)
fd = raw_socket(client_config.ifindex); fd = raw_socket(client_config.ifindex);
else /* LISTEN_NONE */
return;
if (fd < 0) {
log_error("FATAL: couldn't listen on socket: %s.", strerror(errno));
exit(EXIT_FAILURE);
}
} }
/* perform a renew */ /* perform a renew */