aboutsummaryrefslogtreecommitdiffstats
path: root/net/netrom/nr_dev.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2006-12-20 02:53:13 -0500
committerLen Brown <len.brown@intel.com>2006-12-20 02:53:13 -0500
commit9774f3384125912eb491ca77f77907324db3ed05 (patch)
tree0bdc7486e911dd9e955b41283ee19ac74521f7bd /net/netrom/nr_dev.c
parent3be11c8f4f2fa194834c2e83540f34da442b8977 (diff)
parentf238085415c56618e042252894f2fcc971add645 (diff)
merge linus into test branch
Diffstat (limited to 'net/netrom/nr_dev.c')
-rw-r--r--net/netrom/nr_dev.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/net/netrom/nr_dev.c b/net/netrom/nr_dev.c
index 9b8eb54971ab..4700d5225b78 100644
--- a/net/netrom/nr_dev.c
+++ b/net/netrom/nr_dev.c
@@ -128,25 +128,37 @@ static int nr_header(struct sk_buff *skb, struct net_device *dev, unsigned short
128 return -37; 128 return -37;
129} 129}
130 130
131static int nr_set_mac_address(struct net_device *dev, void *addr) 131static int __must_check nr_set_mac_address(struct net_device *dev, void *addr)
132{ 132{
133 struct sockaddr *sa = addr; 133 struct sockaddr *sa = addr;
134 int err;
135
136 if (!memcmp(dev->dev_addr, sa->sa_data, dev->addr_len))
137 return 0;
138
139 if (dev->flags & IFF_UP) {
140 err = ax25_listen_register((ax25_address *)sa->sa_data, NULL);
141 if (err)
142 return err;
134 143
135 if (dev->flags & IFF_UP)
136 ax25_listen_release((ax25_address *)dev->dev_addr, NULL); 144 ax25_listen_release((ax25_address *)dev->dev_addr, NULL);
145 }
137 146
138 memcpy(dev->dev_addr, sa->sa_data, dev->addr_len); 147 memcpy(dev->dev_addr, sa->sa_data, dev->addr_len);
139 148
140 if (dev->flags & IFF_UP)
141 ax25_listen_register((ax25_address *)dev->dev_addr, NULL);
142
143 return 0; 149 return 0;
144} 150}
145 151
146static int nr_open(struct net_device *dev) 152static int nr_open(struct net_device *dev)
147{ 153{
154 int err;
155
156 err = ax25_listen_register((ax25_address *)dev->dev_addr, NULL);
157 if (err)
158 return err;
159
148 netif_start_queue(dev); 160 netif_start_queue(dev);
149 ax25_listen_register((ax25_address *)dev->dev_addr, NULL); 161
150 return 0; 162 return 0;
151} 163}
152 164