diff options
author | Mark Stapp <mjs@voltanet.io> | 2018-09-21 22:21:15 +0200 |
---|---|---|
committer | Mark Stapp <mjs@voltanet.io> | 2018-10-25 14:57:04 +0200 |
commit | 71077c48607aa9cf466958989f512e2d695307a2 (patch) | |
tree | c83f28cde62c55b5760dc0b5862b1927f49748bf /zebra/zebra_netns_notify.c | |
parent | zebra: limit queued route updates (diff) | |
download | frr-71077c48607aa9cf466958989f512e2d695307a2.tar.xz frr-71077c48607aa9cf466958989f512e2d695307a2.zip |
zebra: improve safety of netns_notify_close()
Additional check to ensure the notify event is still valid
before calling the thread lib api.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/zebra_netns_notify.c')
-rw-r--r-- | zebra/zebra_netns_notify.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c index 2608ffd7a..4d2aefa23 100644 --- a/zebra/zebra_netns_notify.c +++ b/zebra/zebra_netns_notify.c @@ -353,8 +353,11 @@ void zebra_ns_notify_close(void) if (zebra_netns_notify_current->u.fd > 0) fd = zebra_netns_notify_current->u.fd; - thread_cancel(zebra_netns_notify_current); - /* auto-removal of inotify items */ + + if (zebra_netns_notify_current->master != NULL) + thread_cancel(zebra_netns_notify_current); + + /* auto-removal of notify items */ if (fd > 0) close(fd); } |