linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mac80211_hwsim: Make sure NEW_RADIO contains final name
@ 2017-02-23 12:02 Andrew Zaborowski
  2017-02-23 12:02 ` [PATCH 2/2][RFC] mac80211_hwsim: Report radio addresses in NEW_RADIO/GET_RADIO Andrew Zaborowski
  2017-02-24  0:08 ` [PATCH 1/2] mac80211_hwsim: Make sure NEW_RADIO contains final name Andrew Zaborowski
  0 siblings, 2 replies; 18+ messages in thread
From: Andrew Zaborowski @ 2017-02-23 12:02 UTC (permalink / raw)
  To: linux-wireless

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 <andrew.zaborowski@intel.com>
---
 drivers/net/wireless/mac80211_hwsim.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 0150747..ba4978d 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
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-03-02  9:01 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-23 12:02 [PATCH 1/2] mac80211_hwsim: Make sure NEW_RADIO contains final name Andrew Zaborowski
2017-02-23 12:02 ` [PATCH 2/2][RFC] mac80211_hwsim: Report radio addresses in NEW_RADIO/GET_RADIO Andrew Zaborowski
2017-02-23 19:01   ` Benjamin Beichler
2017-02-24  0:02     ` Andrew Zaborowski
2017-02-24  0:25       ` Ben Greear
2017-02-27 13:27   ` Johannes Berg
2017-02-27 15:26     ` Andrew Zaborowski
2017-02-27 17:10       ` Ben Greear
2017-02-28  1:23         ` Andrew Zaborowski
2017-02-28  1:57           ` Ben Greear
2017-03-01 14:33             ` Benjamin Beichler
2017-03-01 15:35               ` Ben Greear
2017-03-01 17:04                 ` Benjamin Beichler
2017-03-02  8:23                   ` Johannes Berg
2017-02-24  0:08 ` [PATCH 1/2] mac80211_hwsim: Make sure NEW_RADIO contains final name Andrew Zaborowski
2017-02-27 13:24   ` Johannes Berg
2017-02-27 15:16     ` Andrew Zaborowski
2017-02-27 16:08       ` Johannes Berg

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).