Commit b0ad5e8b authored by Patrik Flykt's avatar Patrik Flykt Committed by Johannes Berg

mac80211_hwsim: Send alpha2 only if non-zero

A properly set alpha2 value consists of two chars that both contain
letters or digits. If no value is set, both chars keep their initial
value zero. Therefore do not send the alpha2 parameter to user space
if either of the characters has been left at its initial zero value.
Signed-off-by: default avatarPatrik Flykt <patrik.flykt@linux.intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 75769c80
...@@ -2541,7 +2541,9 @@ static int mac80211_hwsim_get_radio(struct sk_buff *skb, ...@@ -2541,7 +2541,9 @@ static int mac80211_hwsim_get_radio(struct sk_buff *skb,
if (cb) if (cb)
genl_dump_check_consistent(cb, hdr, &hwsim_genl_family); genl_dump_check_consistent(cb, hdr, &hwsim_genl_family);
param.reg_alpha2 = data->alpha2; if (data->alpha2[0] && data->alpha2[1])
param.reg_alpha2 = data->alpha2;
param.reg_strict = !!(data->hw->wiphy->regulatory_flags & param.reg_strict = !!(data->hw->wiphy->regulatory_flags &
REGULATORY_STRICT_REG); REGULATORY_STRICT_REG);
param.p2p_device = !!(data->hw->wiphy->interface_modes & param.p2p_device = !!(data->hw->wiphy->interface_modes &
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment