From: Bogdan Purcareata Date: Fri, 28 Mar 2014 14:31:41 +0000 (-0400) Subject: config_network_type: set macvlan default mode to private X-Git-Tag: lxc-1.1.0.alpha1~185 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=261658e80014c031852a024f8794dd7f2a2351ad;p=thirdparty%2Flxc.git 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: Bogdan Purcareata Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index d6cf1511c..90fb34400 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -303,6 +303,8 @@ out: return ret; } +static int macvlan_mode(int *valuep, const char *value); + static int config_network_type(const char *key, const char *value, struct lxc_conf *lxc_conf) { @@ -337,8 +339,10 @@ static int config_network_type(const char *key, const char *value, if (!strcmp(value, "veth")) netdev->type = LXC_NET_VETH; - else if (!strcmp(value, "macvlan")) + else if (!strcmp(value, "macvlan")) { netdev->type = LXC_NET_MACVLAN; + macvlan_mode(&netdev->priv.macvlan_attr.mode, "private"); + } else if (!strcmp(value, "vlan")) netdev->type = LXC_NET_VLAN; else if (!strcmp(value, "phys"))