Re: [PATCH v3 01/17] nl80211: Migrate to current netlink key message format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 17.08.19 um 23:14 schrieb Alexander Wetzel:
@@ -6194,9 +6217,11 @@ static int get_key_handler(struct nl_msg *msg, void *arg)
  	 * the kernel starts sending key notifications.
  	 */
- if (tb[NL80211_ATTR_KEY_SEQ])
-		memcpy(arg, nla_data(tb[NL80211_ATTR_KEY_SEQ]),
-		       min_int(nla_len(tb[NL80211_ATTR_KEY_SEQ]), 6));
+	if (tb[NL80211_ATTR_KEY] &&
+	    !nla_parse_nested(attrs, NL80211_KEY_MAX, tb[NL80211_ATTR_KEY],
+			      key_policy))
+		memcpy(arg, nla_data(attrs[NL80211_KEY_SEQ]),
+		       min_int(nla_len(attrs[NL80211_KEY_SEQ]), 16));
  	nl80211_nlmsg_clear(msg);
  	return NL_SKIP;
  }
@@ -6208,16 +6233,19 @@ static int i802_get_seqnum(const char *iface, void *priv, const u8 *addr,
  	struct i802_bss *bss = priv;
  	struct wpa_driver_nl80211_data *drv = bss->drv;
  	struct nl_msg *msg;
+	struct nlattr *key_attr;
msg = nl80211_ifindex_msg(drv, if_nametoindex(iface), 0,
  				  NL80211_CMD_GET_KEY);
  	if (!msg ||
  	    (addr && nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) ||
-	    nla_put_u8(msg, NL80211_ATTR_KEY_IDX, idx)) {
+	    (key_attr = nla_nest_start(msg, NL80211_ATTR_KEY)) ||
+	    nla_put_u8(msg, NL80211_KEY_IDX, idx)) {
  		nlmsg_free(msg);
  		return -ENOBUFS;
  	}
+ nla_nest_end(msg, key_attr);
  	memset(seq, 0, 6);
return send_and_recv_msgs(drv, msg, get_key_handler, seq);

That part of the patch is wrong: The linux kernel is still only using the old netlink format here.

Guess it's now high time to send out V4...

Alexander

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux