mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
Merge pull request #18704 from Pdoijode/pdoijode/zapi-cancel-new-accept
Some checks are pending
build-test / Build the x86 ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu x86 docker image (push) Blocked by required conditions
build-test / Build the ARM ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu ARM docker image (push) Blocked by required conditions
Some checks are pending
build-test / Build the x86 ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu x86 docker image (push) Blocked by required conditions
build-test / Build the ARM ubuntu 22.04 docker image (push) Waiting to run
build-test / Test ubuntu ARM docker image (push) Blocked by required conditions
zebra: Cancel new client accept events after zsock is closed
This commit is contained in:
commit
fc21c74db5
|
@ -895,19 +895,20 @@ void zserv_release_client(struct zserv *client)
|
|||
*/
|
||||
static void zserv_accept(struct event *thread)
|
||||
{
|
||||
int accept_sock;
|
||||
int client_sock;
|
||||
struct sockaddr_in client;
|
||||
socklen_t len;
|
||||
|
||||
accept_sock = EVENT_FD(thread);
|
||||
if (zsock < 0) {
|
||||
/* Return if this event pops after zsock is closed. */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Reregister myself. */
|
||||
zserv_event(NULL, ZSERV_ACCEPT);
|
||||
|
||||
len = sizeof(struct sockaddr_in);
|
||||
client_sock = accept(accept_sock, (struct sockaddr *)&client, &len);
|
||||
|
||||
client_sock = accept(zsock, (struct sockaddr *)&client, &len);
|
||||
if (client_sock < 0) {
|
||||
flog_err_sys(EC_LIB_SOCKET, "Can't accept zebra socket: %s",
|
||||
safe_strerror(errno));
|
||||
|
|
Loading…
Reference in a new issue