@@ -1274,15 +1274,13 @@ void p2p_group_notif_formation_done(struct p2p_group *group);
* p2p_group_notif_noa - Notification of NoA change
* @group: P2P group context from p2p_group_init()
* @noa: Notice of Absence attribute payload, %NULL if none
- * @noa_len: Length of noa buffer in octets
* Returns: 0 on success, -1 on failure
*
* Notify the P2P group management about a new NoA contents. This will be
* inserted into the P2P IEs in Beacon and Probe Response frames with rest of
* the group information.
*/
-int p2p_group_notif_noa(struct p2p_group *group, const u8 *noa,
- size_t noa_len);
+int p2p_group_notif_noa(struct p2p_group *group, struct wpabuf *noa);
/**
* p2p_group_match_dev_type - Match device types in group with requested type
@@ -169,8 +169,6 @@ static void p2p_group_add_noa(struct wpabuf *ie, struct wpabuf *noa)
if (noa == NULL)
return;
/* Notice of Absence */
- wpabuf_put_u8(ie, P2P_ATTR_NOTICE_OF_ABSENCE);
- wpabuf_put_le16(ie, wpabuf_len(noa));
wpabuf_put_buf(ie, noa);
}
@@ -500,17 +498,16 @@ void p2p_group_notif_formation_done(struct p2p_group *group)
}
-int p2p_group_notif_noa(struct p2p_group *group, const u8 *noa,
- size_t noa_len)
+int p2p_group_notif_noa(struct p2p_group *group, struct wpabuf *noa)
{
if (noa == NULL) {
wpabuf_free(group->noa);
group->noa = NULL;
} else {
if (group->noa) {
- if (wpabuf_size(group->noa) >= noa_len) {
+ if (wpabuf_size(group->noa) >= wpabuf_len(noa)) {
group->noa->used = 0;
- wpabuf_put_data(group->noa, noa, noa_len);
+ wpabuf_put_buf(group->noa, noa);
} else {
wpabuf_free(group->noa);
group->noa = NULL;
@@ -518,7 +515,7 @@ int p2p_group_notif_noa(struct p2p_group *group, const u8 *noa,
}
if (!group->noa) {
- group->noa = wpabuf_alloc_copy(noa, noa_len);
+ group->noa = wpabuf_dup(noa);
if (group->noa == NULL)
return -1;
}