diff options
| author | Olivier Dugeon <olivier.dugeon@orange.com> | 2018-01-30 11:43:25 +0100 |
|---|---|---|
| committer | Olivier Dugeon <olivier.dugeon@orange.com> | 2018-01-30 11:43:25 +0100 |
| commit | dab8b7a81c42c62a3effbcf157ff6a125871792c (patch) | |
| tree | b6d84054818466bd1ba72ad401272e668cb6b07d /lib/thread.c | |
| parent | c97dbe20a19a43dce7a1cb37cf96b2b3d66d77ca (diff) | |
| parent | 15fa114fedcdb94f1de8d18b84bba6e16007e74b (diff) | |
Merge remote-tracking 'frr/master' into SR-Routing
Diffstat (limited to 'lib/thread.c')
| -rw-r--r-- | lib/thread.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/thread.c b/lib/thread.c index d26db88550..9d64663d9c 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -919,6 +919,8 @@ struct thread *funcname_thread_add_event(struct thread_master *m, */ static void thread_cancel_rw(struct thread_master *master, int fd, short state) { + bool found = false; + /* Cancel POLLHUP too just in case some bozo set it */ state |= POLLHUP; @@ -926,8 +928,18 @@ static void thread_cancel_rw(struct thread_master *master, int fd, short state) nfds_t i; for (i = 0; i < master->handler.pfdcount; i++) - if (master->handler.pfds[i].fd == fd) + if (master->handler.pfds[i].fd == fd) { + found = true; break; + } + + if (!found) { + zlog_debug( + "[!] Received cancellation request for nonexistent rw job"); + zlog_debug("[!] threadmaster: %s | fd: %d", + master->name ? master->name : "", fd); + return; + } /* NOT out event. */ master->handler.pfds[i].events &= ~(state); |
