diff options
author | Krzysztof Halasa <khc@pm.waw.pl> | 2008-02-01 16:39:50 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-02-05 13:31:40 -0500 |
commit | 47eaa267a5db1729d238f977364e297b8963e115 (patch) | |
tree | d0185dcffbbb272ac422a00a9c0e44cf7850438b /drivers/net/wan | |
parent | 40d25142f2ef27084fc317ac8bb5bae460c8ea72 (diff) |
Generic HDLC - use random_ether_addr()
Generic HDLC now uses random_ether_addr() for generating MAC addresse
for Ethernet-alike interfaces.
Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r-- | drivers/net/wan/hdlc_fr.c | 8 | ||||
-rw-r--r-- | drivers/net/wan/hdlc_raw_eth.c | 4 |
2 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 2bd609c27068..c4ab0326f911 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <linux/init.h> | 42 | #include <linux/init.h> |
43 | #include <linux/skbuff.h> | 43 | #include <linux/skbuff.h> |
44 | #include <linux/pkt_sched.h> | 44 | #include <linux/pkt_sched.h> |
45 | #include <linux/random.h> | ||
46 | #include <linux/inetdevice.h> | 45 | #include <linux/inetdevice.h> |
47 | #include <linux/lapb.h> | 46 | #include <linux/lapb.h> |
48 | #include <linux/rtnetlink.h> | 47 | #include <linux/rtnetlink.h> |
@@ -1120,10 +1119,9 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type) | |||
1120 | return -ENOBUFS; | 1119 | return -ENOBUFS; |
1121 | } | 1120 | } |
1122 | 1121 | ||
1123 | if (type == ARPHRD_ETHER) { | 1122 | if (type == ARPHRD_ETHER) |
1124 | memcpy(dev->dev_addr, "\x00\x01", 2); | 1123 | random_ether_addr(dev->dev_addr); |
1125 | get_random_bytes(dev->dev_addr + 2, ETH_ALEN - 2); | 1124 | else { |
1126 | } else { | ||
1127 | *(__be16*)dev->dev_addr = htons(dlci); | 1125 | *(__be16*)dev->dev_addr = htons(dlci); |
1128 | dlci_to_q922(dev->broadcast, dlci); | 1126 | dlci_to_q922(dev->broadcast, dlci); |
1129 | } | 1127 | } |
diff --git a/drivers/net/wan/hdlc_raw_eth.c b/drivers/net/wan/hdlc_raw_eth.c index 11b16bdfe6aa..d20c685f6711 100644 --- a/drivers/net/wan/hdlc_raw_eth.c +++ b/drivers/net/wan/hdlc_raw_eth.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/skbuff.h> | 19 | #include <linux/skbuff.h> |
20 | #include <linux/pkt_sched.h> | 20 | #include <linux/pkt_sched.h> |
21 | #include <linux/random.h> | ||
22 | #include <linux/inetdevice.h> | 21 | #include <linux/inetdevice.h> |
23 | #include <linux/lapb.h> | 22 | #include <linux/lapb.h> |
24 | #include <linux/rtnetlink.h> | 23 | #include <linux/rtnetlink.h> |
@@ -107,8 +106,7 @@ static int raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr) | |||
107 | ether_setup(dev); | 106 | ether_setup(dev); |
108 | dev->change_mtu = old_ch_mtu; | 107 | dev->change_mtu = old_ch_mtu; |
109 | dev->tx_queue_len = old_qlen; | 108 | dev->tx_queue_len = old_qlen; |
110 | memcpy(dev->dev_addr, "\x00\x01", 2); | 109 | random_ether_addr(dev->dev_addr); |
111 | get_random_bytes(dev->dev_addr + 2, ETH_ALEN - 2); | ||
112 | netif_dormant_off(dev); | 110 | netif_dormant_off(dev); |
113 | return 0; | 111 | return 0; |
114 | } | 112 | } |