From 9cd56d71a84c470aa92422144a76d42c8ff6d11d Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 11 Apr 2018 11:36:25 +0200 Subject: sys/linux: add veth devices to devnames Also comment new veth code for future me. --- executor/common_linux.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'executor/common_linux.h') diff --git a/executor/common_linux.h b/executor/common_linux.h index 1d82a78e3..90566cb26 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -416,6 +416,7 @@ static void initialize_netdevices(void) #endif for (i = 0; i < sizeof(devtypes) / (sizeof(devtypes[0])); i++) execute_command(0, "ip link add dev %s0 type %s", devtypes[i], devtypes[i]); + // This adds connected veth0 and veth1 devices. execute_command(0, "ip link add type veth"); for (i = 0; i < sizeof(devnames) / (sizeof(devnames[0])); i++) { char addr[32]; @@ -430,7 +431,9 @@ static void initialize_netdevices(void) execute_command(0, "ip link set dev %s address %s", devnames[i], addr); execute_command(0, "ip link set dev %s up", devnames[i]); } - + // This creates connected bond_slave and team_slave devices of type veth, + // and makes them slaves of bond0 and team0 devices, respectively. + // Note: slave devices don't need MAC/IP addresses, only master devices. execute_command(0, "ip link add name bond_slave type veth peer name team_slave"); execute_command(0, "ip link set bond_slave master bond0"); execute_command(0, "ip link set team_slave master team0"); -- cgit mrf-deployment