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
75bfe33f
Commit
75bfe33f
authored
Jan 13, 2004
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: When registering a new notifier, rebroadcast REGISTER and UP events.
parent
f8df510e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
net/core/dev.c
net/core/dev.c
+19
-1
No files found.
net/core/dev.c
View file @
75bfe33f
...
...
@@ -996,11 +996,29 @@ int dev_close(struct net_device *dev)
* The notifier passed is linked into the kernel structures and must
* not be reused until it has been unregistered. A negative errno code
* is returned on a failure.
*
* When registered all registration and up events are replayed
* to the new notifier to allow device to have a race free
* view of the network device list.
*/
int
register_netdevice_notifier
(
struct
notifier_block
*
nb
)
{
return
notifier_chain_register
(
&
netdev_chain
,
nb
);
struct
net_device
*
dev
;
int
err
;
rtnl_lock
();
err
=
notifier_chain_register
(
&
netdev_chain
,
nb
);
if
(
!
err
)
{
for
(
dev
=
dev_base
;
dev
;
dev
=
dev
->
next
)
{
nb
->
notifier_call
(
nb
,
NETDEV_REGISTER
,
dev
);
if
(
dev
->
flags
&
IFF_UP
)
nb
->
notifier_call
(
nb
,
NETDEV_UP
,
dev
);
}
}
rtnl_unlock
();
return
err
;
}
/**
...
...
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