diff mbox series

[V2,1/2] nl80211: add NL80211_ATTR_IFINDEX to port authorized event

Message ID 1557395289-41133-2-git-send-email-chi-hsien.lin@cypress.com (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series nl80211: brcmfmac: add port authorized event support | expand

Commit Message

Chi-Hsien Lin May 9, 2019, 9:48 a.m. UTC
From: Chung-Hsien Hsu <stanley.hsu@cypress.com>

Add NL80211_ATTR_IFINDEX attribute to port authorized event to indicate
the operating interface of the device. Also put NL80211_ATTR_WIPHY
attribute in it to be consistent with the other MLME notifications.

Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
---
 net/wireless/nl80211.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index fffe4b371e23..539873120627 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -15034,7 +15034,9 @@  void nl80211_send_port_authorized(struct cfg80211_registered_device *rdev,
 		return;
 	}
 
-	if (nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid))
+	if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
+	    nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) ||
+	    nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid))
 		goto nla_put_failure;
 
 	genlmsg_end(msg, hdr);