Skip to content

Commit bd14ecd

Browse files
authored
Merge pull request FRRouting#19999 from FRRouting/mergify/bp/stable/10.1/pr-19994
lib: mgmt_msg: fix bug with disconnect and event scheduling (backport FRRouting#19994)
2 parents c8d7551 + 39da8bc commit bd14ecd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/mgmt_msg.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,10 @@ void msg_conn_disconnect(struct msg_conn *conn, bool reconnect)
563563
close(conn->fd);
564564
conn->fd = -1;
565565

566+
/* We need to unschedule any pending events on this fd */
567+
event_cancel(&conn->read_ev);
568+
event_cancel(&conn->write_ev);
569+
566570
/* Notify client through registered callback (if any) */
567571
if (conn->notify_disconnect)
568572
(void)(*conn->notify_disconnect)(conn);

0 commit comments

Comments
 (0)