netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] bridge: remove !IFF_UP restriction when deleting bridge from ioctl
@ 2014-04-04 14:56 Dan Williams
  2014-04-04 15:08 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Williams @ 2014-04-04 14:56 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

netlink doesn't care about IFF_UP when deleting a bridge, so "ip link
del br0" works just fine.  The ioctl does care, which means that brctl
complains "bridge br0 still up; can't delete it".  Make things
consistent by always allowing bridge deletion even if the bridge is up.

Signed-off-by: Dan Williams <dcbw@redhat.com>
---
Question: does anyone consider the ioctl behavior API?  Can we change it
even though it's been this way forever?  It means that bridges that
previously would not have been deleted by brctl will now be deleted.
But anyone using /sbin/ip could already delete them.

diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 54d207d..33cd83f 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -264,19 +264,14 @@ int br_del_bridge(struct net *net, const char *name)
 		ret =  -ENXIO; 	/* Could not find device */
 
 	else if (!(dev->priv_flags & IFF_EBRIDGE)) {
 		/* Attempt to delete non bridge device! */
 		ret = -EPERM;
 	}
 
-	else if (dev->flags & IFF_UP) {
-		/* Not shutdown yet. */
-		ret = -EBUSY;
-	}
-
 	else
 		br_dev_delete(dev, NULL);
 
 	rtnl_unlock();
 	return ret;
 }
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-04 17:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-04 14:56 [RFC PATCH] bridge: remove !IFF_UP restriction when deleting bridge from ioctl Dan Williams
2014-04-04 15:08 ` David Miller
2014-04-04 15:15   ` Dan Williams
2014-04-04 17:23     ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).