]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: do not check union on wrong net type
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 24 Aug 2017 22:02:47 +0000 (00:02 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 29 Aug 2017 20:54:47 +0000 (22:54 +0200)
This will obviously not work.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index a77b3df9e138d7e9b2d7aee89f95fa0a57387908..8a11ff345984020a894b1fc35422d6d1ac1571b4 100644 (file)
@@ -3049,27 +3049,6 @@ int lxc_create_network(struct lxc_handler *handler)
 
                netdev = iterator->elem;
 
-               if (netdev->type != LXC_NET_MACVLAN && netdev->priv.macvlan_attr.mode) {
-                       ERROR("Invalid macvlan.mode for a non-macvlan netdev");
-                       return -1;
-               }
-
-               if (netdev->type != LXC_NET_VETH && netdev->priv.veth_attr.pair) {
-                       ERROR("Invalid veth pair for a non-veth netdev");
-                       return -1;
-               }
-
-               if (netdev->type != LXC_NET_VLAN && netdev->priv.vlan_attr.vid > 0) {
-                       ERROR("Invalid vlan.id for a non-macvlan netdev");
-                       return -1;
-               }
-
-               if (netdev->type < 0 || netdev->type > LXC_NET_MAXCONFTYPE) {
-                       ERROR("invalid network configuration type '%d'",
-                             netdev->type);
-                       return -1;
-               }
-
                if (netdev_conf[netdev->type](handler, netdev)) {
                        ERROR("failed to create netdev");
                        return -1;
@@ -3114,9 +3093,9 @@ bool lxc_delete_network(struct lxc_handler *handler)
                if (ret < 0)
                        WARN("Failed to deconfigure network device");
 
-               /* Recent kernel remove the virtual interfaces when the network
+               /* Recent kernels remove the virtual interfaces when the network
                 * namespace is destroyed but in case we did not move the
-                * interface to the network namespace, we have to destroy it
+                * interface to the network namespace, we have to destroy it.
                 */
                ret = lxc_netdev_delete_by_index(netdev->ifindex);
                if (-ret == ENODEV) {