]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Allow ns delete to happen after under/over flow checks
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 17 Dec 2018 02:36:49 +0000 (21:36 -0500)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 18 Dec 2018 16:57:53 +0000 (17:57 +0100)
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 <sharpd@cumulusnetworks.com>
zebra/zebra_netns_notify.c

index 3f69b98413b11739c093bbdbf957e560ef42baf5..a4e10221482012a9204287860f7c3a92a525c57d 100644 (file)
@@ -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;