Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33308
b: refs/heads/master
c: 70f8e78
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Aug 8, 2006
1 parent 1877b05 commit c4f7745
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 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: 1b2a720506ccf7c30baaeda5d990c29b31e21726
refs/heads/master: 70f8e78e150425b01c1099087ad3decacf7e4ccf
15 changes: 14 additions & 1 deletion trunk/net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
}

if (ida[IFLA_ADDRESS - 1]) {
struct sockaddr *sa;
int len;

if (!dev->set_mac_address) {
err = -EOPNOTSUPP;
goto out;
Expand All @@ -405,7 +408,17 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
if (ida[IFLA_ADDRESS - 1]->rta_len != RTA_LENGTH(dev->addr_len))
goto out;

err = dev->set_mac_address(dev, RTA_DATA(ida[IFLA_ADDRESS - 1]));
len = sizeof(sa_family_t) + dev->addr_len;
sa = kmalloc(len, GFP_KERNEL);
if (!sa) {
err = -ENOMEM;
goto out;
}
sa->sa_family = dev->type;
memcpy(sa->sa_data, RTA_DATA(ida[IFLA_ADDRESS - 1]),
dev->addr_len);
err = dev->set_mac_address(dev, sa);
kfree(sa);
if (err)
goto out;
send_addr_notify = 1;
Expand Down

0 comments on commit c4f7745

Please sign in to comment.