summaryrefslogtreecommitdiff
path: root/system-dummy.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 /system-dummy.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 'system-dummy.c')
-rw-r--r--system-dummy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/system-dummy.c b/system-dummy.c
index 9c37bd5..2669a34 100644
--- a/system-dummy.c
+++ b/system-dummy.c
@@ -54,9 +54,9 @@ int system_bridge_delif(struct device *bridge, struct device *dev)
return 0;
}
-int system_link_netns_move(const char *ifname, int netns_fd)
+int system_link_netns_move(const char *ifname, int netns_fd, const char *target_ifname)
{
- D(SYSTEM, "ip link %s netns %d\n", ifname, netns_fd);
+ D(SYSTEM, "ip link dev %s name %s netns %d\n", ifname, target_ifname, netns_fd);
return 0;
}