diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-01-06 07:41:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-07 00:05:02 -0500 |
commit | 2afb9b533423a9b97f84181e773cf9361d98fed6 (patch) | |
tree | 9fa30187fe1c2e6275e2b7d00f52095b8bef5629 | |
parent | efc61a3442da9fd17a61fcabef445534598f54a8 (diff) |
ethtool: set addr_assign_type to NET_ADDR_SET when addr is passed on create
In case user passed address via netlink during create, NET_ADDR_PERM was set.
That is not correct so fix this by setting NET_ADDR_SET.
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/rtnetlink.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 9969afb82271..9a419b099482 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -1667,9 +1667,11 @@ struct net_device *rtnl_create_link(struct net *net, | |||
1667 | 1667 | ||
1668 | if (tb[IFLA_MTU]) | 1668 | if (tb[IFLA_MTU]) |
1669 | dev->mtu = nla_get_u32(tb[IFLA_MTU]); | 1669 | dev->mtu = nla_get_u32(tb[IFLA_MTU]); |
1670 | if (tb[IFLA_ADDRESS]) | 1670 | if (tb[IFLA_ADDRESS]) { |
1671 | memcpy(dev->dev_addr, nla_data(tb[IFLA_ADDRESS]), | 1671 | memcpy(dev->dev_addr, nla_data(tb[IFLA_ADDRESS]), |
1672 | nla_len(tb[IFLA_ADDRESS])); | 1672 | nla_len(tb[IFLA_ADDRESS])); |
1673 | dev->addr_assign_type = NET_ADDR_SET; | ||
1674 | } | ||
1673 | if (tb[IFLA_BROADCAST]) | 1675 | if (tb[IFLA_BROADCAST]) |
1674 | memcpy(dev->broadcast, nla_data(tb[IFLA_BROADCAST]), | 1676 | memcpy(dev->broadcast, nla_data(tb[IFLA_BROADCAST]), |
1675 | nla_len(tb[IFLA_BROADCAST])); | 1677 | nla_len(tb[IFLA_BROADCAST])); |