int hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
- const u8 *addr, int idx, u8 *seq)
+ const u8 *addr, int idx, int link_id, u8 *seq)
{
if (hapd->driver == NULL || hapd->driver->get_seqnum == NULL)
return 0;
return hapd->driver->get_seqnum(ifname, hapd->drv_priv, addr, idx,
- seq);
+ link_id, seq);
}
int hostapd_set_ieee8021x(struct hostapd_data *hapd,
struct wpa_bss_params *params);
int hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
- const u8 *addr, int idx, u8 *seq);
+ const u8 *addr, int idx, int link_id, u8 *seq);
int hostapd_flush(struct hostapd_data *hapd);
int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode,
int freq, int channel, int edmg, u8 edmg_channel,
u8 *seq)
{
struct hostapd_data *hapd = ctx;
- return hostapd_get_seqnum(hapd->conf->iface, hapd, addr, idx, seq);
+ int link_id = -1;
+
+#ifdef CONFIG_IEEE80211BE
+ if (hapd->conf->mld_ap && idx)
+ link_id = hapd->mld_link_id;
+#endif /* CONFIG_IEEE80211BE */
+ return hostapd_get_seqnum(hapd->conf->iface, hapd, addr, idx, link_id,
+ seq);
}
* @priv: Private driver interface data
* @addr: MAC address of the station or %NULL for group keys
* @idx: Key index
+ * @link_id: Link ID for a group key, or -1 if not set
* @seq: Buffer for returning the latest used TSC/packet number
* Returns: 0 on success, -1 on failure
*
* unicast keys (i.e., addr != %NULL).
*/
int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
- int idx, u8 *seq);
+ int idx, int link_id, u8 *seq);
/**
* flush - Flush all association stations (AP only)
static int
atheros_get_seqnum(const char *ifname, void *priv, const u8 *addr, int idx,
- u8 *seq)
+ int link_id, u8 *seq)
{
struct atheros_driver_data *drv = priv;
struct ieee80211req_key wk;
static int
bsd_get_seqnum(const char *ifname, void *priv, const u8 *addr, int idx,
- u8 *seq)
+ int link_id, u8 *seq)
{
struct ieee80211req_key wk;
static int hostap_get_seqnum(const char *ifname, void *priv, const u8 *addr,
- int idx, u8 *seq)
+ int idx, int link_id, u8 *seq)
{
struct hostap_driver_data *drv = priv;
struct prism2_hostapd_param *param;
static int i802_get_seqnum(const char *iface, void *priv, const u8 *addr,
- int idx, u8 *seq)
+ int idx, int link_id, u8 *seq)
{
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
struct nl_msg *msg;
+ int res;
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)) ||
+ (link_id != NL80211_DRV_LINK_ID_NA &&
+ nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id)) ||
nla_put_u8(msg, NL80211_ATTR_KEY_IDX, idx)) {
nlmsg_free(msg);
return -ENOBUFS;
}
- memset(seq, 0, 6);
+ os_memset(seq, 0, 6);
+ res = send_and_recv_msgs(drv, msg, get_key_handler, seq, NULL, NULL);
+ if (res) {
+ wpa_printf(MSG_DEBUG,
+ "nl80211: Failed to get current TX sequence for a key (link_id=%d idx=%d): %d (%s)",
+ link_id, idx, res, strerror(-res));
+ }
- return send_and_recv_msgs(drv, msg, get_key_handler, seq, NULL, NULL);
+ return res;
}
{
if (wpa_s->driver->get_seqnum)
return wpa_s->driver->get_seqnum(wpa_s->ifname, wpa_s->drv_priv,
- addr, idx, seq);
+ addr, idx, -1, seq);
return -1;
}