|
@@ -699,10 +699,20 @@ static u8 p2ps_group_capability(void *ctx, u8 incoming, u8 role)
|
|
/* If a required role has been specified, handle it here */
|
|
/* If a required role has been specified, handle it here */
|
|
if (role && role != P2PS_SETUP_NEW) {
|
|
if (role && role != P2PS_SETUP_NEW) {
|
|
switch (incoming) {
|
|
switch (incoming) {
|
|
|
|
+ case P2PS_SETUP_GROUP_OWNER | P2PS_SETUP_NEW:
|
|
|
|
+ case P2PS_SETUP_GROUP_OWNER | P2PS_SETUP_CLIENT:
|
|
|
|
+ /*
|
|
|
|
+ * Peer has an active GO, so if the role allows it and
|
|
|
|
+ * we do not have any active roles, become client.
|
|
|
|
+ */
|
|
|
|
+ if ((role & P2PS_SETUP_CLIENT) && !go_wpa_s &&
|
|
|
|
+ !cli_wpa_s)
|
|
|
|
+ return P2PS_SETUP_CLIENT;
|
|
|
|
+
|
|
|
|
+ /* fall through */
|
|
|
|
+
|
|
case P2PS_SETUP_NONE:
|
|
case P2PS_SETUP_NONE:
|
|
case P2PS_SETUP_NEW:
|
|
case P2PS_SETUP_NEW:
|
|
- case P2PS_SETUP_GROUP_OWNER | P2PS_SETUP_CLIENT:
|
|
|
|
- case P2PS_SETUP_GROUP_OWNER | P2PS_SETUP_NEW:
|
|
|
|
conncap = role;
|
|
conncap = role;
|
|
goto grp_owner;
|
|
goto grp_owner;
|
|
|
|
|
|
@@ -758,6 +768,13 @@ static u8 p2ps_group_capability(void *ctx, u8 incoming, u8 role)
|
|
|
|
|
|
case P2PS_SETUP_GROUP_OWNER | P2PS_SETUP_NEW:
|
|
case P2PS_SETUP_GROUP_OWNER | P2PS_SETUP_NEW:
|
|
case P2PS_SETUP_GROUP_OWNER | P2PS_SETUP_CLIENT:
|
|
case P2PS_SETUP_GROUP_OWNER | P2PS_SETUP_CLIENT:
|
|
|
|
+ /*
|
|
|
|
+ * Peer has an active GO, so if the role allows it and
|
|
|
|
+ * we do not have any active roles, become client.
|
|
|
|
+ */
|
|
|
|
+ if ((role & P2PS_SETUP_CLIENT) && !go_wpa_s && !cli_wpa_s)
|
|
|
|
+ return P2PS_SETUP_CLIENT;
|
|
|
|
+
|
|
if (cli_wpa_s)
|
|
if (cli_wpa_s)
|
|
conncap = P2PS_SETUP_GROUP_OWNER;
|
|
conncap = P2PS_SETUP_GROUP_OWNER;
|
|
else {
|
|
else {
|