Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290206
b: refs/heads/master
c: 95f2054
h: refs/heads/master
v: v3
  • Loading branch information
Danny Kukawka authored and David S. Miller committed Feb 17, 2012
1 parent 98c44ec commit 2d4704d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6a214fd4142d585ef2226e8ef6bc29a15403506f
refs/heads/master: 95f2054f167f7da72b0771984dbb2bec612740d0
11 changes: 8 additions & 3 deletions trunk/arch/um/drivers/net_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ static void uml_net_user_timer_expire(unsigned long _conn)
#endif
}

static void setup_etheraddr(char *str, unsigned char *addr, char *name)
static int setup_etheraddr(char *str, unsigned char *addr, char *name)
{
char *end;
int i;
Expand Down Expand Up @@ -334,12 +334,13 @@ static void setup_etheraddr(char *str, unsigned char *addr, char *name)
addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4],
addr[5]);
}
return;
return 0;

random:
printk(KERN_INFO
"Choosing a random ethernet address for device %s\n", name);
random_ether_addr(addr);
return 1;
}

static DEFINE_SPINLOCK(devices_lock);
Expand Down Expand Up @@ -391,6 +392,7 @@ static void eth_configure(int n, void *init, char *mac,
struct net_device *dev;
struct uml_net_private *lp;
int err, size;
int random_mac;

size = transport->private_size + sizeof(struct uml_net_private);

Expand All @@ -417,7 +419,7 @@ static void eth_configure(int n, void *init, char *mac,
*/
snprintf(dev->name, sizeof(dev->name), "eth%d", n);

setup_etheraddr(mac, device->mac, dev->name);
random_mac = setup_etheraddr(mac, device->mac, dev->name);

printk(KERN_INFO "Netdevice %d (%pM) : ", n, device->mac);

Expand Down Expand Up @@ -474,6 +476,9 @@ static void eth_configure(int n, void *init, char *mac,

/* don't use eth_mac_addr, it will not work here */
memcpy(dev->dev_addr, device->mac, ETH_ALEN);
if (random_mac)
dev->addr_assign_type |= NET_ADDR_RANDOM;

dev->mtu = transport->user->mtu;
dev->netdev_ops = &uml_netdev_ops;
dev->ethtool_ops = &uml_net_ethtool_ops;
Expand Down

0 comments on commit 2d4704d

Please sign in to comment.