From: Andrew Zaborowski Date: Thu, 23 Feb 2017 12:02:10 +0000 (+0100) Subject: mac80211_hwsim: Make sure NEW_RADIO contains final name X-Git-Tag: v4.12-rc1~129^2~155^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f7d3b4f5203832f57ece96300888323fd5a6c6b3;p=platform%2Fkernel%2Flinux-exynos.git mac80211_hwsim: Make sure NEW_RADIO contains final name ieee80211_alloc_hw_nm will validate the requested name (if any) before creating the new device and may use a name different from the one requested rather than fail. Make sure the HWSIM_CMD_NEW_RADIO event/response generated has the final name or userspace will receive the wrong name. Note that mac80211_hwsim_new_radio may now modify params. A check for duplicate radio name could be added separately. Signed-off-by: Andrew Zaborowski Signed-off-by: Johannes Berg --- diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 307a53a..7b9662a 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -2438,6 +2438,9 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, goto failed; } + /* ieee80211_alloc_hw_nm may have used a default name */ + param->hwname = wiphy_name(hw->wiphy); + if (info) net = genl_info_net(info); else