aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_linux.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-04-11 11:36:25 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-04-11 11:36:25 +0200
commit9cd56d71a84c470aa92422144a76d42c8ff6d11d (patch)
tree8c904de5471ce9094d68ee93e5b2e5047fb5436d /executor/common_linux.h
parentcde43bc6bc3f8d3434d99f4e313c95f6b0ac53ec (diff)
sys/linux: add veth devices to devnames
Also comment new veth code for future me.
Diffstat (limited to 'executor/common_linux.h')
-rw-r--r--executor/common_linux.h5
1 files changed, 4 insertions, 1 deletions
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");