Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0a361a5 authored by Andrei Otcheretianski's avatar Andrei Otcheretianski Committed by Johannes Berg
Browse files

nl80211: fix channel switch parsing



The nl80211 attribute NL80211_ATTR_CSA_C_OFF_BEACON should be nested
inside NL80211_ATTR_CSA_IES, but commit ee4bc9e7
("nl80211: enable IBSS support for channel switch announcements")
added a check in the outer message attributes.

Fix channel switch calls by removing the erroneus condition.

Signed-off-by: default avatarAndrei Otcheretianski <andrei.otcheretianski@intel.com>
[reword commit message]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 0bb861e6
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -5713,9 +5713,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)
		return -EINVAL;

	/* only important for AP, IBSS and mesh create IEs internally */
	if (need_new_beacon &&
	    (!info->attrs[NL80211_ATTR_CSA_IES] ||
	     !info->attrs[NL80211_ATTR_CSA_C_OFF_BEACON]))
	if (need_new_beacon && !info->attrs[NL80211_ATTR_CSA_IES])
		return -EINVAL;

	params.count = nla_get_u32(info->attrs[NL80211_ATTR_CH_SWITCH_COUNT]);