Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2afb9b53 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

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: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent efc61a34
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1667,9 +1667,11 @@ struct net_device *rtnl_create_link(struct net *net,

	if (tb[IFLA_MTU])
		dev->mtu = nla_get_u32(tb[IFLA_MTU]);
	if (tb[IFLA_ADDRESS])
	if (tb[IFLA_ADDRESS]) {
		memcpy(dev->dev_addr, nla_data(tb[IFLA_ADDRESS]),
				nla_len(tb[IFLA_ADDRESS]));
		dev->addr_assign_type = NET_ADDR_SET;
	}
	if (tb[IFLA_BROADCAST])
		memcpy(dev->broadcast, nla_data(tb[IFLA_BROADCAST]),
				nla_len(tb[IFLA_BROADCAST]));