diff --git a/src/netdev.c b/src/netdev.c index 7a14f1dd..7f4101be 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -4338,6 +4338,7 @@ static uint32_t netdev_send_action_framev(struct netdev *netdev, { uint32_t id; struct l_genl_msg *msg = nl80211_build_cmd_frame(netdev->index, + 0x00d0, netdev->addr, to, freq, iov, iov_len); diff --git a/src/nl80211util.c b/src/nl80211util.c index 8fe86ee6..5ba0097f 100644 --- a/src/nl80211util.c +++ b/src/nl80211util.c @@ -431,6 +431,7 @@ const void *nl80211_parse_get_key_seq(struct l_genl_msg *msg) } struct l_genl_msg *nl80211_build_cmd_frame(uint32_t ifindex, + uint16_t frame_type, const uint8_t *addr, const uint8_t *to, uint32_t freq, @@ -439,18 +440,17 @@ struct l_genl_msg *nl80211_build_cmd_frame(uint32_t ifindex, { struct l_genl_msg *msg; struct iovec iovs[iov_len + 1]; - const uint16_t frame_type = 0x00d0; - uint8_t action_frame[24]; + uint8_t hdr[24]; - memset(action_frame, 0, 24); + memset(hdr, 0, 24); - l_put_le16(frame_type, action_frame + 0); - memcpy(action_frame + 4, to, 6); - memcpy(action_frame + 10, addr, 6); - memcpy(action_frame + 16, to, 6); + l_put_le16(frame_type, hdr + 0); + memcpy(hdr + 4, to, 6); + memcpy(hdr + 10, addr, 6); + memcpy(hdr + 16, to, 6); - iovs[0].iov_base = action_frame; - iovs[0].iov_len = sizeof(action_frame); + iovs[0].iov_base = hdr; + iovs[0].iov_len = sizeof(hdr); memcpy(iovs + 1, iov, sizeof(*iov) * iov_len); msg = l_genl_msg_new_sized(NL80211_CMD_FRAME, 128 + 512); diff --git a/src/nl80211util.h b/src/nl80211util.h index 1d32b700..44555a25 100644 --- a/src/nl80211util.h +++ b/src/nl80211util.h @@ -49,6 +49,7 @@ struct l_genl_msg *nl80211_build_get_key(uint32_t ifindex, uint8_t key_index); const void *nl80211_parse_get_key_seq(struct l_genl_msg *msg); struct l_genl_msg *nl80211_build_cmd_frame(uint32_t ifindex, + uint16_t frame_type, const uint8_t *addr, const uint8_t *to, uint32_t freq, diff --git a/src/rrm.c b/src/rrm.c index fceff5c7..ed44cee6 100644 --- a/src/rrm.c +++ b/src/rrm.c @@ -194,7 +194,7 @@ static bool rrm_send_response(struct rrm_state *rrm, iov.iov_base = (void *)frame; iov.iov_len = len; - msg = nl80211_build_cmd_frame(rrm->ifindex, own_addr, bss->addr, + msg = nl80211_build_cmd_frame(rrm->ifindex, 0x00d0, own_addr, bss->addr, bss->frequency, &iov, 1); if (!l_genl_family_send(nl80211, msg, rrm_send_response_cb,