diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/rose/rose_dev.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c index 7c279e2659ec..50824d345fa6 100644 --- a/net/rose/rose_dev.c +++ b/net/rose/rose_dev.c | |||
@@ -93,20 +93,34 @@ static int rose_rebuild_header(struct sk_buff *skb) | |||
93 | static int rose_set_mac_address(struct net_device *dev, void *addr) | 93 | static int rose_set_mac_address(struct net_device *dev, void *addr) |
94 | { | 94 | { |
95 | struct sockaddr *sa = addr; | 95 | struct sockaddr *sa = addr; |
96 | int err; | ||
96 | 97 | ||
97 | rose_del_loopback_node((rose_address *)dev->dev_addr); | 98 | if (!memcpy(dev->dev_addr, sa->sa_data, dev->addr_len)) |
99 | return 0; | ||
98 | 100 | ||
99 | memcpy(dev->dev_addr, sa->sa_data, dev->addr_len); | 101 | if (dev->flags & IFF_UP) { |
102 | err = rose_add_loopback_node((rose_address *)dev->dev_addr); | ||
103 | if (err) | ||
104 | return err; | ||
105 | |||
106 | rose_del_loopback_node((rose_address *)dev->dev_addr); | ||
107 | } | ||
100 | 108 | ||
101 | rose_add_loopback_node((rose_address *)dev->dev_addr); | 109 | memcpy(dev->dev_addr, sa->sa_data, dev->addr_len); |
102 | 110 | ||
103 | return 0; | 111 | return 0; |
104 | } | 112 | } |
105 | 113 | ||
106 | static int rose_open(struct net_device *dev) | 114 | static int rose_open(struct net_device *dev) |
107 | { | 115 | { |
116 | int err; | ||
117 | |||
118 | err = rose_add_loopback_node((rose_address *)dev->dev_addr); | ||
119 | if (err) | ||
120 | return err; | ||
121 | |||
108 | netif_start_queue(dev); | 122 | netif_start_queue(dev); |
109 | rose_add_loopback_node((rose_address *)dev->dev_addr); | 123 | |
110 | return 0; | 124 | return 0; |
111 | } | 125 | } |
112 | 126 | ||