Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314689
b: refs/heads/master
c: d4fc691
h: refs/heads/master
i:
  314687: 4f1be06
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Jun 28, 2012
1 parent c3ae2b6 commit 7f92db1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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: e9976d7c96423ac1991396aa82335206ded55bcf
refs/heads/master: d4fc6918f4b3cc844185f59fc518351525950449
9 changes: 5 additions & 4 deletions trunk/drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,11 +679,12 @@ static int virtnet_set_mac_address(struct net_device *dev, void *p)
{
struct virtnet_info *vi = netdev_priv(dev);
struct virtio_device *vdev = vi->vdev;
int ret;
struct sockaddr *addr = p;

ret = eth_mac_addr(dev, p);
if (ret)
return ret;
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
dev->addr_assign_type &= ~NET_ADDR_RANDOM;

if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC))
vdev->config->set(vdev, offsetof(struct virtio_net_config, mac),
Expand Down

0 comments on commit 7f92db1

Please sign in to comment.