* [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* Re: [RFC PATCH] bridge: remove !IFF_UP restriction when deleting bridge from ioctl
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
0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2014-04-04 15:08 UTC (permalink / raw)
To: dcbw; +Cc: stephen, netdev
From: Dan Williams <dcbw@redhat.com>
Date: Fri, 04 Apr 2014 09:56:22 -0500
> 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.
Unfortunately I think we're stuck with the existing behavior.
And since, as you say, iproute2 always does the removal when
the device is up, the behavior you desire is available.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC PATCH] bridge: remove !IFF_UP restriction when deleting bridge from ioctl
2014-04-04 15:08 ` David Miller
@ 2014-04-04 15:15 ` Dan Williams
2014-04-04 17:23 ` Stephen Hemminger
0 siblings, 1 reply; 4+ messages in thread
From: Dan Williams @ 2014-04-04 15:15 UTC (permalink / raw)
To: David Miller; +Cc: stephen, netdev
On Fri, 2014-04-04 at 11:08 -0400, David Miller wrote:
> From: Dan Williams <dcbw@redhat.com>
> Date: Fri, 04 Apr 2014 09:56:22 -0500
>
> > 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.
>
> Unfortunately I think we're stuck with the existing behavior.
Ok, fair enough.
Dan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC PATCH] bridge: remove !IFF_UP restriction when deleting bridge from ioctl
2014-04-04 15:15 ` Dan Williams
@ 2014-04-04 17:23 ` Stephen Hemminger
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2014-04-04 17:23 UTC (permalink / raw)
To: Dan Williams; +Cc: David Miller, netdev
On Fri, 04 Apr 2014 10:15:50 -0500
Dan Williams <dcbw@redhat.com> wrote:
> On Fri, 2014-04-04 at 11:08 -0400, David Miller wrote:
> > From: Dan Williams <dcbw@redhat.com>
> > Date: Fri, 04 Apr 2014 09:56:22 -0500
> >
> > > 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.
> >
> > Unfortunately I think we're stuck with the existing behavior.
>
> Ok, fair enough.
>
> Dan
>
>
That is the way it has been all the way back to 2.4.
^ permalink raw reply [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