#include "memory.h"
#include "lib_errors.h"
-#include "zserv.h"
+#include "zebra_router.h"
#include "zebra_memory.h"
#endif /* defined(HAVE_NETLINK) */
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)
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);
}
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;
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)
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,
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;
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)