* [patch net-next] ethtool: set addr_assign_type to NET_ADDR_SET when addr is passed on create
@ 2013-01-06 22:41 Jiri Pirko
2013-01-07 5:05 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jiri Pirko @ 2013-01-06 22:41 UTC (permalink / raw)
To: netdev; +Cc: davem, bhutchings, shemminger, sassmann
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>
---
net/core/rtnetlink.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 9969afb..9a419b0 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -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]));
--
1.8.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch net-next] ethtool: set addr_assign_type to NET_ADDR_SET when addr is passed on create
2013-01-06 22:41 [patch net-next] ethtool: set addr_assign_type to NET_ADDR_SET when addr is passed on create Jiri Pirko
@ 2013-01-07 5:05 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-01-07 5:05 UTC (permalink / raw)
To: jiri; +Cc: netdev, bhutchings, shemminger, sassmann
From: Jiri Pirko <jiri@resnulli.us>
Date: Sun, 6 Jan 2013 23:41:57 +0100
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-07 5:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-06 22:41 [patch net-next] ethtool: set addr_assign_type to NET_ADDR_SET when addr is passed on create Jiri Pirko
2013-01-07 5:05 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).