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 <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-12-16 21:36:49 -05:00 committed by Philippe Guibert
parent 8c7de11843
commit 01b4cb3ed6

View 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;