zebra: upon associating netns with vrf, prileges are raised

In order to create the netns context, the zebra parser at startup needs
to have its privileges raised.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2018-03-13 14:51:31 +01:00
parent c1a0038782
commit 1c9d288e49

View File

@ -92,7 +92,11 @@ static void zebra_ns_notify_create_context_from_entry_name(const char *name)
zlog_warn("NS notify : failed to create VRF %s", name);
return;
}
if (zserv_privs.change(ZPRIVS_RAISE))
zlog_err("Can't raise privileges");
ret = vrf_netns_handler_create(NULL, vrf, netnspath, ns_id);
if (zserv_privs.change(ZPRIVS_LOWER))
zlog_err("Can't lower privileges");
if (ret != CMD_SUCCESS) {
zlog_warn("NS notify : failed to create NS %s", netnspath);
return;