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
ec731ce0
Commit
ec731ce0
authored
Apr 09, 2004
by
Stephen Hemminger
Committed by
David S. Miller
Apr 09, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Use random address in dummy driver.
parent
ed58762a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
drivers/net/dummy.c
drivers/net/dummy.c
+15
-0
No files found.
drivers/net/dummy.c
View file @
ec731ce0
...
...
@@ -32,6 +32,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/moduleparam.h>
...
...
@@ -40,6 +41,17 @@ static int numdummies = 1;
static
int
dummy_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
);
static
struct
net_device_stats
*
dummy_get_stats
(
struct
net_device
*
dev
);
static
int
dummy_set_address
(
struct
net_device
*
dev
,
void
*
p
)
{
struct
sockaddr
*
sa
=
p
;
if
(
!
is_valid_ether_addr
(
sa
->
sa_data
))
return
-
EADDRNOTAVAIL
;
memcpy
(
dev
->
dev_addr
,
sa
->
sa_data
,
ETH_ALEN
);
return
0
;
}
/* fake multicast ability */
static
void
set_multicast_list
(
struct
net_device
*
dev
)
{
...
...
@@ -58,6 +70,7 @@ static void __init dummy_setup(struct net_device *dev)
dev
->
get_stats
=
dummy_get_stats
;
dev
->
hard_start_xmit
=
dummy_xmit
;
dev
->
set_multicast_list
=
set_multicast_list
;
dev
->
set_mac_address
=
dummy_set_address
;
#ifdef CONFIG_NET_FASTROUTE
dev
->
accept_fastpath
=
dummy_accept_fastpath
;
#endif
...
...
@@ -68,6 +81,7 @@ static void __init dummy_setup(struct net_device *dev)
dev
->
flags
|=
IFF_NOARP
;
dev
->
flags
&=
~
IFF_MULTICAST
;
SET_MODULE_OWNER
(
dev
);
random_ether_addr
(
dev
->
dev_addr
);
}
static
int
dummy_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
...
...
@@ -90,6 +104,7 @@ static struct net_device **dummies;
/* Number of dummy devices to be set up by this module. */
module_param
(
numdummies
,
int
,
0
);
MODULE_PARM_DESC
(
numdimmies
,
"Number of dummy psuedo devices"
);
static
int
__init
dummy_init_one
(
int
index
)
{
...
...
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