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
Kirill Smelkov
linux
Commits
fccd3231
Commit
fccd3231
authored
Jan 15, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge davem@nuts.ninka.net:/home/davem/src/BK/net-2.5
into kernel.bkbits.net:/home/davem/net-2.5
parents
6e5878dc
41dad9af
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
2 deletions
+29
-2
include/linux/netdevice.h
include/linux/netdevice.h
+1
-0
net/core/dev.c
net/core/dev.c
+12
-0
net/core/rtnetlink.c
net/core/rtnetlink.c
+15
-2
net/netsyms.c
net/netsyms.c
+1
-0
No files found.
include/linux/netdevice.h
View file @
fccd3231
...
...
@@ -480,6 +480,7 @@ extern int register_netdevice(struct net_device *dev);
extern
int
unregister_netdevice
(
struct
net_device
*
dev
);
extern
int
register_netdevice_notifier
(
struct
notifier_block
*
nb
);
extern
int
unregister_netdevice_notifier
(
struct
notifier_block
*
nb
);
extern
int
call_netdevice_notifiers
(
unsigned
long
val
,
void
*
v
);
extern
int
dev_new_index
(
void
);
extern
struct
net_device
*
dev_get_by_index
(
int
ifindex
);
extern
struct
net_device
*
__dev_get_by_index
(
int
ifindex
);
...
...
net/core/dev.c
View file @
fccd3231
...
...
@@ -877,6 +877,18 @@ int unregister_netdevice_notifier(struct notifier_block *nb)
return
notifier_chain_unregister
(
&
netdev_chain
,
nb
);
}
/**
* call_netdevice_notifiers - call all network notifier blocks
*
* Call all network notifier blocks. Parameters and return value
* are as for notifier_call_chain().
*/
int
call_netdevice_notifiers
(
unsigned
long
val
,
void
*
v
)
{
return
notifier_call_chain
(
&
netdev_chain
,
val
,
v
);
}
/*
* Support routine. Sends outgoing frames to any network
* taps currently in use.
...
...
net/core/rtnetlink.c
View file @
fccd3231
...
...
@@ -234,10 +234,20 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
err
=
-
EINVAL
;
if
(
ida
[
IFLA_ADDRESS
-
1
])
{
if
(
!
dev
->
set_mac_address
)
{
err
=
-
EOPNOTSUPP
;
goto
out
;
}
if
(
!
netif_device_present
(
dev
))
{
err
=
-
ENODEV
;
goto
out
;
}
if
(
ida
[
IFLA_ADDRESS
-
1
]
->
rta_len
!=
RTA_LENGTH
(
dev
->
addr_len
))
goto
out
;
memcpy
(
dev
->
dev_addr
,
RTA_DATA
(
ida
[
IFLA_ADDRESS
-
1
]),
dev
->
addr_len
);
err
=
dev
->
set_mac_address
(
dev
,
RTA_DATA
(
ida
[
IFLA_ADDRESS
-
1
]));
if
(
err
)
goto
out
;
}
if
(
ida
[
IFLA_BROADCAST
-
1
])
{
...
...
@@ -250,6 +260,9 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
err
=
0
;
out:
if
(
!
err
)
call_netdevice_notifiers
(
NETDEV_CHANGEADDR
,
dev
);
dev_put
(
dev
);
return
err
;
}
...
...
net/netsyms.c
View file @
fccd3231
...
...
@@ -508,6 +508,7 @@ EXPORT_SYMBOL(tr_type_trans);
/* Device callback registration */
EXPORT_SYMBOL
(
register_netdevice_notifier
);
EXPORT_SYMBOL
(
unregister_netdevice_notifier
);
EXPORT_SYMBOL
(
call_netdevice_notifiers
);
/* support for loadable net drivers */
#ifdef CONFIG_NET
...
...
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