Patchwork [1/1] P2P Client should not issue p2p_find

login
register
mail settings
Submitter Eduardo Abinader
Date Feb. 13, 2014, 9:12 p.m.
Message ID <1392325962-11708-1-git-send-email-eduardo.abinader@openbossa.org>
Download mbox | patch
Permalink /patch/320174/
State New
Headers show

Comments

Eduardo Abinader - Feb. 13, 2014, 9:12 p.m.
According to WFA-P2P, p2p client interfaces should not
probe request while participating a P2P group. This
patch enforces this behavior.

Signed-off-by: Eduardo Abinader <eduardo.abinader@openbossa.org>
---
 wpa_supplicant/p2p_supplicant.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Jouni Malinen - Feb. 13, 2014, 9:38 p.m.
On Thu, Feb 13, 2014 at 05:12:42PM -0400, Eduardo Abinader wrote:
> According to WFA-P2P, p2p client interfaces should not
> probe request while participating a P2P group. This
> patch enforces this behavior.

Could you please point to a exact clause and sentence that you believe
disallows this? It does not sound useful to prevent device discovery
while in a group, so I'm not going to apply this.
Eduardo Abinader - Feb. 13, 2014, 10:17 p.m.
If you connect wpa_cli to a p2p interface, p2p_find fails.

Page 96 states PB can be trasmitted by any P2P Device (not P2P client or
GO), thus this patch still allows P2P device (ifname==wlan*) to p2p_find,
as p2p_group_interface==NOT_P2P_GROUP_INTERFACE.
This patch only disallows a P2P Client (not a P2P device),
ifname==p2p-wlan* to p2p_find.



On Thu, Feb 13, 2014 at 5:38 PM, Jouni Malinen <j@w1.fi> wrote:

> On Thu, Feb 13, 2014 at 05:12:42PM -0400, Eduardo Abinader wrote:
> > According to WFA-P2P, p2p client interfaces should not
> > probe request while participating a P2P group. This
> > patch enforces this behavior.
>
> Could you please point to a exact clause and sentence that you believe
> disallows this? It does not sound useful to prevent device discovery
> while in a group, so I'm not going to apply this.
>
> --
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>
Jouni Malinen - Feb. 14, 2014, 9:35 a.m.
On Thu, Feb 13, 2014 at 06:17:16PM -0400, Eduardo Abinader wrote:
> If you connect wpa_cli to a p2p interface, p2p_find fails.

Which driver are you using? Which operation fails?

> Page 96 states PB can be trasmitted by any P2P Device (not P2P client or
> GO), thus this patch still allows P2P device (ifname==wlan*) to p2p_find,
> as p2p_group_interface==NOT_P2P_GROUP_INTERFACE.
> This patch only disallows a P2P Client (not a P2P device),
> ifname==p2p-wlan* to p2p_find.

p2p_find is always performed in P2P Device role. Whether it is issued on
a control interface for another interface should not really matter much
and it could be more convenient to just route the request to the correct
instance within wpa_supplicant instead of rejecting it. I'm not sure
whether there could be external programs that end up using a random
control interface by not specifying any, so there is some risk of
regressions with this type of changes. The new global control interface
design avoids this, but similar redirection of the control interface
command could be used here as well.
Eduardo Abinader - Feb. 14, 2014, 11:03 a.m.
On Fri, Feb 14, 2014 at 5:35 AM, Jouni Malinen <j@w1.fi> wrote:

> On Thu, Feb 13, 2014 at 06:17:16PM -0400, Eduardo Abinader wrote:
> > If you connect wpa_cli to a p2p interface, p2p_find fails.
>
> Which driver are you using? Which operation fails?
>
>
It fails with my patch, considering the info below.



> > Page 96 states PB can be trasmitted by any P2P Device (not P2P client or
> > GO), thus this patch still allows P2P device (ifname==wlan*) to p2p_find,
> > as p2p_group_interface==NOT_P2P_GROUP_INTERFACE.
> > This patch only disallows a P2P Client (not a P2P device),
> > ifname==p2p-wlan* to p2p_find.
>
> p2p_find is always performed in P2P Device role. Whether it is issued on
> a control interface for another interface should not really matter much
> and it could be more convenient to just route the request to the correct
> instance within wpa_supplicant instead of rejecting it. I'm not sure
> whether there could be external programs that end up using a random
> control interface by not specifying any, so there is some risk of
> regressions with this type of changes. The new global control interface
> design avoids this, but similar redirection of the control interface
> command could be used here as well.
>
>
I was just thinking about a ConnMan-like listing p2p interfaces and getting
them to use via wpa_s dbus interfaces. This patch would prevent such
non-standard procedures.



> --
> Jouni Malinen                                           PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>

Patch

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 1495ea4..6ad6eda 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -5497,7 +5497,8 @@  int wpas_p2p_find(struct wpa_supplicant *wpa_s, unsigned int timeout,
 	wpa_s->p2p_long_listen = 0;
 
 	if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL ||
-	    wpa_s->p2p_in_provisioning)
+	    wpa_s->p2p_in_provisioning ||
+	    wpa_s->p2p_group_interface == P2P_GROUP_INTERFACE_CLIENT)
 		return -1;
 
 	wpa_supplicant_cancel_sched_scan(wpa_s);