]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
config_network_type: set macvlan default mode to private
authorBogdan Purcareata <bogdan.purcareata@freescale.com>
Fri, 28 Mar 2014 14:31:41 +0000 (10:31 -0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Sat, 29 Mar 2014 00:09:28 +0000 (19:09 -0500)
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 <bogdan.purcareata@freescale.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/confile.c

index d6cf1511c174fdb4d90b4043a65cf077480e986c..90fb34400fdd923d0ca354b365c0091e918a71db 100644 (file)
@@ -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"))