summaryrefslogtreecommitdiff
path: root/zebra/zebra_ns.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2018-08-10 18:36:43 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-08-14 20:02:05 +0000
commit01b9e3fd0d354d7d4c60b1c0240f269a4fd08990 (patch)
tree7758a10d2c803e86348e04e908f73b63c0048b96 /zebra/zebra_ns.c
parent6017c3a2e71304381af5cfa5020b4a1358ee098b (diff)
*: use frr_elevate_privs() (1/2: coccinelle)
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'zebra/zebra_ns.c')
-rw-r--r--zebra/zebra_ns.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/zebra/zebra_ns.c b/zebra/zebra_ns.c
index 7bf5ced934..456253cc30 100644
--- a/zebra/zebra_ns.c
+++ b/zebra/zebra_ns.c
@@ -315,11 +315,9 @@ int zebra_ns_init(void)
dzns = zebra_ns_alloc();
- if (zserv_privs.change(ZPRIVS_RAISE))
- flog_err(LIB_ERR_PRIVILEGES, "Can't raise privileges");
- ns_id = zebra_ns_id_get_default();
- if (zserv_privs.change(ZPRIVS_LOWER))
- flog_err(LIB_ERR_PRIVILEGES, "Can't lower privileges");
+ frr_elevate_privs(&zserv_privs) {
+ ns_id = zebra_ns_id_get_default();
+ }
ns_id_external = ns_map_nsid_with_external(ns_id, true);
ns_init_management(ns_id_external, ns_id);