From 01b4cb3ed6181d7200f66e0187b1e5c5db6c0e5a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 16 Dec 2018 21:36:49 -0500 Subject: [PATCH] zebra: Allow ns delete to happen after under/over flow checks Allow the ns deletion event to happen *after* the data validity checks. Please note this probably still leaves a weird hole if we receive multiple namespace events ( as the for loop implies ). We will stop handling anything after a namespace deletion notification. Signed-off-by: Donald Sharp --- zebra/zebra_netns_notify.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c index 3f69b9841..a4e102214 100644 --- a/zebra/zebra_netns_notify.c +++ b/zebra/zebra_netns_notify.c @@ -252,8 +252,6 @@ static int zebra_ns_notify_read(struct thread *t) if (!(event->mask & (IN_CREATE | IN_DELETE))) continue; - if (event->mask & IN_DELETE) - return zebra_ns_delete(event->name); if (offsetof(struct inotify_event, name) + event->len >= sizeof(buf)) { @@ -268,6 +266,9 @@ static int zebra_ns_notify_read(struct thread *t) break; } + if (event->mask & IN_DELETE) + return zebra_ns_delete(event->name); + netnspath = ns_netns_pathname(NULL, event->name); if (!netnspath) continue; -- 2.39.5