[lxc-devel] [PATCH] config_network_type: set macvlan default mode to private

Serge Hallyn serge.hallyn at ubuntu.com
Sat Mar 29 00:09:02 UTC 2014


Quoting Bogdan Purcareata (bogdan.purcareata at freescale.com):
> 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 at freescale.com>

Thanks!

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  src/lxc/confile.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/lxc/confile.c b/src/lxc/confile.c
> index d6cf151..90fb344 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"))
> -- 
> 1.9.rc1
> 
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list