* [PATCH] nl80211: use loop index as type for net detect frequency results
@ 2015-02-09 19:29 Luca Coelho
2015-02-24 9:54 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Luca Coelho @ 2015-02-09 19:29 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, pstew, samueltan
From: Samuel Tan <samueltan@chromium.org>
We currently add nested members of the NL80211_ATTR_SCAN_FREQUENCIES
as NLA_U32 attributes of type NL80211_ATTR_WIPHY_FREQ in
cfg80211_net_detect_results. However, since there can be an arbitrary number of
frequency results, we should use the loop index of the loop used to add the
frequency results to NL80211_ATTR_SCAN_FREQUENCIES as the type (i.e. nla_type)
for each result attribute, rather than a fixed type.
This change is in line with how nested members are added to
NL80211_ATTR_SCAN_FREQUENCIES in the functions nl80211_send_wowlan_nd and
nl80211_add_scan_req.
Signed-off-by: Samuel Tan <samueltan@chromium.org>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
---
net/wireless/nl80211.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 454d7a0..57ab1ac 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -12520,9 +12520,7 @@ static int cfg80211_net_detect_results(struct sk_buff *msg,
}
for (j = 0; j < match->n_channels; j++) {
- if (nla_put_u32(msg,
- NL80211_ATTR_WIPHY_FREQ,
- match->channels[j])) {
+ if (nla_put_u32(msg, j, match->channels[j])) {
nla_nest_cancel(msg, nl_freqs);
nla_nest_cancel(msg, nl_match);
goto out;
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nl80211: use loop index as type for net detect frequency results
2015-02-09 19:29 [PATCH] nl80211: use loop index as type for net detect frequency results Luca Coelho
@ 2015-02-24 9:54 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2015-02-24 9:54 UTC (permalink / raw)
To: Luca Coelho; +Cc: linux-wireless, pstew, samueltan
On Mon, 2015-02-09 at 21:29 +0200, Luca Coelho wrote:
> From: Samuel Tan <samueltan@chromium.org>
>
> We currently add nested members of the NL80211_ATTR_SCAN_FREQUENCIES
> as NLA_U32 attributes of type NL80211_ATTR_WIPHY_FREQ in
> cfg80211_net_detect_results. However, since there can be an arbitrary number of
> frequency results, we should use the loop index of the loop used to add the
> frequency results to NL80211_ATTR_SCAN_FREQUENCIES as the type (i.e. nla_type)
> for each result attribute, rather than a fixed type.
>
> This change is in line with how nested members are added to
> NL80211_ATTR_SCAN_FREQUENCIES in the functions nl80211_send_wowlan_nd and
> nl80211_add_scan_req.
Applied, thanks.
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-24 9:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-09 19:29 [PATCH] nl80211: use loop index as type for net detect frequency results Luca Coelho
2015-02-24 9:54 ` 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).