From: David Ward Date: Mon, 17 Jan 2011 09:18:50 +0000 (+0100) Subject: Only bring up network interface if IFF_UP is set X-Git-Tag: lxc-0.7.4-rc1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0efbac48e8646ba62aca04b43acaa887ef4ec81;p=thirdparty%2Flxc.git Only bring up network interface if IFF_UP is set 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 Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index a1bce19ec..2201519fc 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -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);