]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
network.c: Add missing LXC_NET_NONE option + refactor
authorBogdan Purcareata <bogdan.purcareata@freescale.com>
Wed, 26 Mar 2014 15:35:09 +0000 (11:35 -0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 26 Mar 2014 14:41:04 +0000 (09:41 -0500)
Add LXC_NET_NONE to known lxc_network_types, so parsing a config
file with lxc.network.type = none does not result in failure
(e.g. doc/examples/lxc-no-netns.conf). Options have also been
reordered to match the enum in conf.h.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/network.c

index 090b9bd6bbc59050e9b51ce79c88bf4b9b7884a8..a9900def335a21a75c5da2fa47f33beaa47a682b 100644 (file)
@@ -1202,11 +1202,12 @@ int lxc_bridge_attach(const char *bridge, const char *ifname)
 }
 
 static const char* const lxc_network_types[LXC_NET_MAXCONFTYPE + 1] = {
+       [LXC_NET_EMPTY]   = "empty",
        [LXC_NET_VETH]    = "veth",
        [LXC_NET_MACVLAN] = "macvlan",
-       [LXC_NET_VLAN]    = "vlan",
        [LXC_NET_PHYS]    = "phys",
-       [LXC_NET_EMPTY]   = "empty",
+       [LXC_NET_VLAN]    = "vlan",
+       [LXC_NET_NONE]    = "none",
 };
 
 const char *lxc_net_type_to_str(int type)