cfg80211: pmsr: fix MAC address setting
authorJohannes Berg <johannes.berg@intel.com>
Wed, 6 Feb 2019 05:59:41 +0000 (07:59 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 6 Feb 2019 09:37:42 +0000 (10:37 +0100)
When we *don't* have a MAC address attribute, we shouldn't
try to use this - this was intended to copy the local MAC
address instead, so fix it.

Fixes: 9bb7e0f24e7e ("cfg80211: add peer measurement with FTM initiator API")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/pmsr.c

index de9286703280a2d8d4306593848676e85d3b1bfe..f2e388e329fdb9084bac99209b4fbae243aeec1a 100644 (file)
@@ -256,8 +256,7 @@ int nl80211_pmsr_start(struct sk_buff *skb, struct genl_info *info)
                if (err)
                        goto out_err;
        } else {
-               memcpy(req->mac_addr, nla_data(info->attrs[NL80211_ATTR_MAC]),
-                      ETH_ALEN);
+               memcpy(req->mac_addr, wdev_address(wdev), ETH_ALEN);
                memset(req->mac_addr_mask, 0xff, ETH_ALEN);
        }