summaryrefslogtreecommitdiff
path: root/ubus.c
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2020-04-13 20:03:35 +0100
committerDaniel Golle <daniel@makrotopia.org>2020-04-14 00:03:00 +0100
commitd93126d3b91ea9e3831b9fd0b5318989f82daebe (patch)
tree0a4df774abf479338d5c66234a675eed8c5e7e5f /ubus.c
parentaaaca2e40895775135b13a1992ff139b7610b217 (diff)
downloadnetifd-d93126d3b91ea9e3831b9fd0b5318989f82daebe.tar.gz
interface: allow renaming interface when moving to jail netns
Introduce jail_ifname option to define the name of a Linux network interface when moved into a jail's network namespace. This is useful for containers which expect the network interface to have a specific name (eg. 'host0' in case of systemd). While at it, clean-up and fix bugs in jail interface up/down routines. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'ubus.c')
-rw-r--r--ubus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ubus.c b/ubus.c
index 85d834d..15c826b 100644
--- a/ubus.c
+++ b/ubus.c
@@ -765,6 +765,9 @@ netifd_dump_status(struct interface *iface)
if (iface->jail)
blobmsg_add_string(&b, "jail", iface->jail);
+ if (iface->jail_ifname)
+ blobmsg_add_string(&b, "jail_ifname", iface->jail_ifname);
+
if (iface->state == IFS_UP) {
if (iface->updated) {
a = blobmsg_open_array(&b, "updated");