]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_cli: Add missing parameter for P2P_GROUP_ADD command
authorMarcin Klimczewski <marcin.klimczewski@tieto.com>
Mon, 4 Jul 2011 17:32:15 +0000 (20:32 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 4 Jul 2011 17:32:15 +0000 (20:32 +0300)
Both freq and persistent parameters of P2P_GROUP_ADD could be passed at
one time.

wpa_supplicant/wpa_cli.c

index a1db53a4fcb9590aa6739b4665803ef5ca00bf73..943985671e1ad8b3194f9d4d152514ee417ae977 100644 (file)
@@ -1786,7 +1786,12 @@ static int wpa_cli_cmd_p2p_group_add(struct wpa_ctrl *ctrl, int argc,
        if (argc == 0)
                return wpa_ctrl_command(ctrl, "P2P_GROUP_ADD");
 
-       res = os_snprintf(cmd, sizeof(cmd), "P2P_GROUP_ADD %s", argv[0]);
+       if (argc > 1)
+               res = os_snprintf(cmd, sizeof(cmd), "P2P_GROUP_ADD %s %s",
+                                 argv[0], argv[1]);
+       else
+               res = os_snprintf(cmd, sizeof(cmd), "P2P_GROUP_ADD %s",
+                                 argv[0]);
        if (res < 0 || (size_t) res >= sizeof(cmd))
                return -1;
        cmd[sizeof(cmd) - 1] = '\0';