diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-06-14 16:38:40 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-08-14 22:02:05 +0200 |
commit | 174482ef377034d2ab3c14df0b4f4191731f1316 (patch) | |
tree | 90d03a36aad22fb51e00d218ffee2aba35950ef9 /zebra/zebra_netns_notify.c | |
parent | lib: Add LIB_ERR_SNMP (diff) | |
download | frr-174482ef377034d2ab3c14df0b4f4191731f1316.tar.xz frr-174482ef377034d2ab3c14df0b4f4191731f1316.zip |
bgpd, lib, zebra: Convert LIB_ERR_PRIVILEGES
For all the places we zlog_err about raising/lowering privileges, use
zlog_ferr.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_netns_notify.c')
-rw-r--r-- | zebra/zebra_netns_notify.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c index 2dd686fd0..8195e493f 100644 --- a/zebra/zebra_netns_notify.c +++ b/zebra/zebra_netns_notify.c @@ -34,6 +34,7 @@ #include "ns.h" #include "command.h" #include "memory.h" +#include "lib_errors.h" #include "zserv.h" #include "zebra_memory.h" @@ -76,10 +77,10 @@ static void zebra_ns_notify_create_context_from_entry_name(const char *name) return; if (zserv_privs.change(ZPRIVS_RAISE)) - zlog_err("Can't raise privileges"); + zlog_ferr(LIB_ERR_PRIVILEGES, "Can't raise privileges"); ns_id = zebra_ns_id_get(netnspath); if (zserv_privs.change(ZPRIVS_LOWER)) - zlog_err("Can't lower privileges"); + zlog_ferr(LIB_ERR_PRIVILEGES, "Can't lower privileges"); if (ns_id == NS_UNKNOWN) return; ns_id_external = ns_map_nsid_with_external(ns_id, true); @@ -97,11 +98,11 @@ static void zebra_ns_notify_create_context_from_entry_name(const char *name) return; } if (zserv_privs.change(ZPRIVS_RAISE)) - zlog_err("Can't raise privileges"); + zlog_ferr(LIB_ERR_PRIVILEGES, "Can't raise privileges"); ret = vrf_netns_handler_create(NULL, vrf, netnspath, ns_id_external, ns_id); if (zserv_privs.change(ZPRIVS_LOWER)) - zlog_err("Can't lower privileges"); + zlog_ferr(LIB_ERR_PRIVILEGES, "Can't lower privileges"); if (ret != CMD_SUCCESS) { zlog_warn("NS notify : failed to create NS %s", netnspath); ns_map_nsid_with_external(ns_id, false); @@ -169,19 +170,19 @@ static int zebra_ns_ready_read(struct thread *t) if (--zns_info->retries == 0) stop_retry = 1; if (zserv_privs.change(ZPRIVS_RAISE)) - zlog_err("Can't raise privileges"); + zlog_ferr(LIB_ERR_PRIVILEGES, "Can't raise privileges"); err = ns_switch_to_netns(netnspath); if (zserv_privs.change(ZPRIVS_LOWER)) - zlog_err("Can't lower privileges"); + zlog_ferr(LIB_ERR_PRIVILEGES, "Can't lower privileges"); if (err < 0) return zebra_ns_continue_read(zns_info, stop_retry); /* go back to default ns */ if (zserv_privs.change(ZPRIVS_RAISE)) - zlog_err("Can't raise privileges"); + zlog_ferr(LIB_ERR_PRIVILEGES, "Can't raise privileges"); err = ns_switchback_to_initial(); if (zserv_privs.change(ZPRIVS_LOWER)) - zlog_err("Can't lower privileges"); + zlog_ferr(LIB_ERR_PRIVILEGES, "Can't lower privileges"); if (err < 0) return zebra_ns_continue_read(zns_info, stop_retry); |