Commit 261658e8 by Bogdan Purcareata Committed by Serge Hallyn

config_network_type: set macvlan default mode to private

If a default mode is not set, the container requires an explicit mode specified in the config file, otherwise creating the container fails. Signed-off-by: 's avatarBogdan Purcareata <bogdan.purcareata@freescale.com> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 718e4f48
...@@ -303,6 +303,8 @@ out: ...@@ -303,6 +303,8 @@ out:
return ret; return ret;
} }
static int macvlan_mode(int *valuep, const char *value);
static int config_network_type(const char *key, const char *value, static int config_network_type(const char *key, const char *value,
struct lxc_conf *lxc_conf) struct lxc_conf *lxc_conf)
{ {
...@@ -337,8 +339,10 @@ static int config_network_type(const char *key, const char *value, ...@@ -337,8 +339,10 @@ static int config_network_type(const char *key, const char *value,
if (!strcmp(value, "veth")) if (!strcmp(value, "veth"))
netdev->type = LXC_NET_VETH; netdev->type = LXC_NET_VETH;
else if (!strcmp(value, "macvlan")) else if (!strcmp(value, "macvlan")) {
netdev->type = LXC_NET_MACVLAN; netdev->type = LXC_NET_MACVLAN;
macvlan_mode(&netdev->priv.macvlan_attr.mode, "private");
}
else if (!strcmp(value, "vlan")) else if (!strcmp(value, "vlan"))
netdev->type = LXC_NET_VLAN; netdev->type = LXC_NET_VLAN;
else if (!strcmp(value, "phys")) else if (!strcmp(value, "phys"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment