nl80211: send the NL80211_ATTR_SSID in nl80211_send_iface()
authorAntonio Quartulli <ordex@autistici.org>
Wed, 7 Nov 2012 11:52:20 +0000 (12:52 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 7 Nov 2012 16:57:14 +0000 (17:57 +0100)
The userspace may want to know what is the current ssid that a given
interface is using. This patch enables nl80211 to send the
NL80211_ATTR_SSID attribute in nl80211_send_iface().

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index e521ca09d6a455d7cc96ce500df845aa57548bc7..c18b2fc9d49241b0d217de18d7a3d30e5316eb8c 100644 (file)
@@ -1787,6 +1787,11 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flag
                        goto nla_put_failure;
        }
 
+       if (wdev->ssid_len) {
+               if (nla_put(msg, NL80211_ATTR_SSID, wdev->ssid_len, wdev->ssid))
+                       goto nla_put_failure;
+       }
+
        return genlmsg_end(msg, hdr);
 
  nla_put_failure: