summaryrefslogtreecommitdiffstats
path: root/watchfrr/watchfrr_vty.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-10-05 02:32:25 +0200
committerDonald Sharp <sharpd@nvidia.com>2021-10-06 18:21:56 +0200
commita91f5417d8e7188b61ddecd4224fbba0f0c61e78 (patch)
tree248af92ad1f970a8d7febdc5b5081fe39f4dfa9c /watchfrr/watchfrr_vty.c
parentMerge pull request #9745 from opensourcerouting/bfd-ospf-topo-improv (diff)
downloadfrr-a91f5417d8e7188b61ddecd4224fbba0f0c61e78.tar.xz
frr-a91f5417d8e7188b61ddecd4224fbba0f0c61e78.zip
watchfrr: Allow an integrated config to work within a namespace
Since watchfrr invokes vtysh to gather the show run output and write the data, if we are operating inside of a namespace FRR must also pass this in. Yes. This seems hacky. I don't fully understand why vtysh is invoked this way. New output: sharpd@eva:~/frr3$ sudo vtysh -N one Hello, this is FRRouting (version 8.1-dev). Copyright 1996-2005 Kunihiro Ishiguro, et al. eva# wr mem Note: this version of vtysh never writes vtysh.conf % Can't open configuration file /etc/frr/one/vtysh.conf due to 'No such file or directory'. Building Configuration... Integrated configuration saved to /etc/frr/one/frr.conf [OK] eva# Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'watchfrr/watchfrr_vty.c')
-rw-r--r--watchfrr/watchfrr_vty.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/watchfrr/watchfrr_vty.c b/watchfrr/watchfrr_vty.c
index eda4f5d51..1492ee37b 100644
--- a/watchfrr/watchfrr_vty.c
+++ b/watchfrr/watchfrr_vty.c
@@ -105,7 +105,10 @@ DEFUN(config_write_integrated,
/* don't allow the user to pass parameters, we're root here!
* should probably harden vtysh at some point too... */
- execl(VTYSH_BIN_PATH, "vtysh", "-w", NULL);
+ if (pathspace)
+ execl(VTYSH_BIN_PATH, "vtysh", "-N", pathspace, "-w", NULL);
+ else
+ execl(VTYSH_BIN_PATH, "vtysh", "-w", NULL);
/* unbuffered write; we just messed with stdout... */
char msg[512];