Only the first seek=<service name> parameter was accepted from the
P2P_FIND command. Fix this to go through all seek parameters to
construct the list of service hash values to seek.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
/* Must be searched for last, because it adds nul termination */
pos = os_strstr(cmd, " seek=");
/* Must be searched for last, because it adds nul termination */
pos = os_strstr(cmd, " seek=");
while (pos && seek_count < P2P_MAX_QUERY_HASH + 1) {
char *term;
while (pos && seek_count < P2P_MAX_QUERY_HASH + 1) {
char *term;
- term = os_strchr(pos + 1, ' ');
- _seek[seek_count++] = pos + 6;
+ _seek[seek_count++] = pos;
- pos = os_strstr(pos + 6, " seek=");
-
- if (term)
- *term = '\0';
+ term = os_strchr(pos, ' ');
+ if (!term)
+ break;
+ *term = '\0';
+ pos = os_strstr(term + 1, "seek=");
+ if (pos)
+ pos += 5;
}
if (seek_count > P2P_MAX_QUERY_HASH) {
seek[0] = NULL;
}
if (seek_count > P2P_MAX_QUERY_HASH) {
seek[0] = NULL;