From: Dan Williams <dcbw@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org
Subject: [RFC PATCH] bridge: remove !IFF_UP restriction when deleting bridge from ioctl
Date: Fri, 04 Apr 2014 09:56:22 -0500 [thread overview]
Message-ID: <1396623382.15118.6.camel@dcbw.local> (raw)
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;
}
next reply other threads:[~2014-04-04 14:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-04 14:56 Dan Williams [this message]
2014-04-04 15:08 ` [RFC PATCH] bridge: remove !IFF_UP restriction when deleting bridge from ioctl David Miller
2014-04-04 15:15 ` Dan Williams
2014-04-04 17:23 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1396623382.15118.6.camel@dcbw.local \
--to=dcbw@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox