]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_netns_notify.c
Merge pull request #5706 from mjstapp/fix_nh_debug_show
[mirror_frr.git] / zebra / zebra_netns_notify.c
index ef31fcf45d3bbc9891cebaaf30cc663be1051cd0..d42cf3d60a22f3527aa3e11fe3334036af4d2961 100644 (file)
@@ -36,7 +36,7 @@
 #include "memory.h"
 #include "lib_errors.h"
 
-#include "zserv.h"
+#include "zebra_router.h"
 #include "zebra_memory.h"
 #endif /* defined(HAVE_NETLINK) */
 
@@ -77,7 +77,7 @@ static void zebra_ns_notify_create_context_from_entry_name(const char *name)
        if (netnspath == NULL)
                return;
 
-       frr_elevate_privs(&zserv_privs) {
+       frr_with_privs(&zserv_privs) {
                ns_id = zebra_ns_id_get(netnspath);
        }
        if (ns_id == NS_UNKNOWN)
@@ -97,7 +97,7 @@ static void zebra_ns_notify_create_context_from_entry_name(const char *name)
                ns_map_nsid_with_external(ns_id, false);
                return;
        }
-       frr_elevate_privs(&zserv_privs) {
+       frr_with_privs(&zserv_privs) {
                ret = vrf_netns_handler_create(NULL, vrf, netnspath,
                                               ns_id_external, ns_id);
        }
@@ -121,7 +121,7 @@ static int zebra_ns_continue_read(struct zebra_netns_info *zns_info,
                XFREE(MTYPE_NETNS_MISC, zns_info);
                return 0;
        }
-       thread_add_timer_msec(zebrad.master, zebra_ns_ready_read,
+       thread_add_timer_msec(zrouter.master, zebra_ns_ready_read,
                              (void *)zns_info, ZEBRA_NS_POLLING_INTERVAL_MSEC,
                              NULL);
        return 0;
@@ -202,14 +202,14 @@ static int zebra_ns_ready_read(struct thread *t)
        netnspath = zns_info->netnspath;
        if (--zns_info->retries == 0)
                stop_retry = 1;
-       frr_elevate_privs(&zserv_privs) {
+       frr_with_privs(&zserv_privs) {
                err = ns_switch_to_netns(netnspath);
        }
        if (err < 0)
                return zebra_ns_continue_read(zns_info, stop_retry);
 
        /* go back to default ns */
-       frr_elevate_privs(&zserv_privs) {
+       frr_with_privs(&zserv_privs) {
                err = ns_switchback_to_initial();
        }
        if (err < 0)
@@ -242,7 +242,7 @@ static int zebra_ns_notify_read(struct thread *t)
        ssize_t len;
 
        zebra_netns_notify_current = thread_add_read(
-               zebrad.master, zebra_ns_notify_read, NULL, fd_monitor, NULL);
+               zrouter.master, zebra_ns_notify_read, NULL, fd_monitor, NULL);
        len = read(fd_monitor, buf, sizeof(buf));
        if (len < 0) {
                flog_err_sys(EC_ZEBRA_NS_NOTIFY_READ,
@@ -284,7 +284,7 @@ static int zebra_ns_notify_read(struct thread *t)
                                    sizeof(struct zebra_netns_info));
                netnsinfo->retries = ZEBRA_NS_POLLING_MAX_RETRIES;
                netnsinfo->netnspath = netnspath;
-               thread_add_timer_msec(zebrad.master, zebra_ns_ready_read,
+               thread_add_timer_msec(zrouter.master, zebra_ns_ready_read,
                                      (void *)netnsinfo, 0, NULL);
        }
        return 0;
@@ -355,7 +355,7 @@ void zebra_ns_notify_init(void)
                             safe_strerror(errno));
        }
        zebra_netns_notify_current = thread_add_read(
-               zebrad.master, zebra_ns_notify_read, NULL, fd_monitor, NULL);
+               zrouter.master, zebra_ns_notify_read, NULL, fd_monitor, NULL);
 }
 
 void zebra_ns_notify_close(void)