[lxc-devel] [PATCH] Only bring up network interface if IFF_UP is set
David Ward
david.ward at ll.mit.edu
Mon Jan 17 02:51:47 UTC 2011
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 at ll.mit.edu>
---
src/lxc/conf.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 2f66e76..a0c5fee 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);
--
1.7.1
More information about the lxc-devel
mailing list