aboutsummaryrefslogtreecommitdiffstats
path: root/net/llc
diff options
context:
space:
mode:
authorPavel Emelianov <xemul@openvz.org>2007-05-03 18:13:45 -0400
committerDavid S. Miller <davem@davemloft.net>2007-05-03 18:13:45 -0400
commit7562f876cd93800f2f8c89445f2a563590b24e09 (patch)
tree78a34c011af275efa0d55ba59c3bd49b771dd533 /net/llc
parent03fba0479600114f32d29eee74ca3eaa364606bf (diff)
[NET]: Rework dev_base via list_head (v3)
Cleanup of dev_base list use, with the aim to simplify making device list per-namespace. In almost every occasion, use of dev_base variable and dev->next pointer could be easily replaced by for_each_netdev loop. A few most complicated places were converted to using first_netdev()/next_netdev(). Signed-off-by: Pavel Emelianov <xemul@openvz.org> Acked-by: Kirill Korotaev <dev@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/llc')
-rw-r--r--net/llc/llc_core.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/llc/llc_core.c b/net/llc/llc_core.c
index d12413cff5bd..d4b13a031fd5 100644
--- a/net/llc/llc_core.c
+++ b/net/llc/llc_core.c
@@ -160,8 +160,14 @@ static struct packet_type llc_tr_packet_type = {
160 160
161static int __init llc_init(void) 161static int __init llc_init(void)
162{ 162{
163 if (dev_base->next) 163 struct net_device *dev;
164 memcpy(llc_station_mac_sa, dev_base->next->dev_addr, ETH_ALEN); 164
165 dev = first_net_device();
166 if (dev != NULL)
167 dev = next_net_device(dev);
168
169 if (dev != NULL)
170 memcpy(llc_station_mac_sa, dev->dev_addr, ETH_ALEN);
165 else 171 else
166 memset(llc_station_mac_sa, 0, ETH_ALEN); 172 memset(llc_station_mac_sa, 0, ETH_ALEN);
167 dev_add_pack(&llc_packet_type); 173 dev_add_pack(&llc_packet_type);