Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
9aecd918
Commit
9aecd918
authored
Oct 04, 2002
by
Lennert Buytenhek
Committed by
David S. Miller
Oct 04, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BRIDGE]: take BR_NETPROTO_LOCK for unlinking bridge device slaves
parent
c6a4620a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
net/bridge/br_if.c
net/bridge/br_if.c
+10
-5
No files found.
net/bridge/br_if.c
View file @
9aecd918
...
...
@@ -18,6 +18,7 @@
#include <linux/if_bridge.h>
#include <linux/inetdevice.h>
#include <linux/rtnetlink.h>
#include <linux/brlock.h>
#include <asm/uaccess.h>
#include "br_private.h"
...
...
@@ -37,7 +38,7 @@ static int br_initial_port_cost(struct net_device *dev)
return
100
;
}
/* called under bridge lock */
/* called under
BR_NETPROTO_LOCK and
bridge lock */
static
int
__br_del_if
(
struct
net_bridge
*
br
,
struct
net_device
*
dev
)
{
struct
net_bridge_port
*
p
;
...
...
@@ -86,10 +87,12 @@ static struct net_bridge **__find_br(char *name)
static
void
del_ifs
(
struct
net_bridge
*
br
)
{
write_lock_bh
(
&
br
->
lock
);
br_write_lock_bh
(
BR_NETPROTO_LOCK
);
write_lock
(
&
br
->
lock
);
while
(
br
->
port_list
!=
NULL
)
__br_del_if
(
br
,
br
->
port_list
->
dev
);
write_unlock_bh
(
&
br
->
lock
);
write_unlock
(
&
br
->
lock
);
br_write_unlock_bh
(
BR_NETPROTO_LOCK
);
}
static
struct
net_bridge
*
new_nb
(
char
*
name
)
...
...
@@ -252,10 +255,12 @@ int br_del_if(struct net_bridge *br, struct net_device *dev)
{
int
retval
;
write_lock_bh
(
&
br
->
lock
);
br_write_lock_bh
(
BR_NETPROTO_LOCK
);
write_lock
(
&
br
->
lock
);
retval
=
__br_del_if
(
br
,
dev
);
br_stp_recalculate_bridge_id
(
br
);
write_unlock_bh
(
&
br
->
lock
);
write_unlock
(
&
br
->
lock
);
br_write_unlock_bh
(
BR_NETPROTO_LOCK
);
return
retval
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment