]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Only bring up network interface if IFF_UP is set
authorDavid Ward <david.ward@ll.mit.edu>
Mon, 17 Jan 2011 09:18:50 +0000 (10:18 +0100)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Mon, 17 Jan 2011 09:18:50 +0000 (10:18 +0100)
Each network interface was brought up regardless of the configuration,
as the wrong boolean operator was being used to test the IFF_UP flag.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/conf.c

index a1bce19ecdff7d41ea937b0de34aedfaadcfbd74..2201519fcac68ad718f05730de2bdbb2f94ccd93 100644 (file)
@@ -1217,7 +1217,7 @@ static int setup_netdev(struct lxc_netdev *netdev)
 
        /* empty network namespace */
        if (!netdev->ifindex) {
-               if (netdev->flags | IFF_UP) {
+               if (netdev->flags & IFF_UP) {
                        err = lxc_device_up("lo");
                        if (err) {
                                ERROR("failed to set the loopback up : %s",
@@ -1281,7 +1281,7 @@ static int setup_netdev(struct lxc_netdev *netdev)
        }
 
        /* set the network device up */
-       if (netdev->flags | IFF_UP) {
+       if (netdev->flags & IFF_UP) {
                int err;
 
                err = lxc_device_up(current_ifname);