diff mbox

[6/9] P2P: Relax the conditions that allow cross-connection

Message ID 1434547101-7342-6-git-send-email-ilan.peer@intel.com
State Changes Requested
Headers show

Commit Message

Peer, Ilan June 17, 2015, 1:18 p.m. UTC
Change the conditions that allow a cross connection to allow
all the interface shared by the same radio, and not only the parent
interface.

This is mostly needed for devices that support a dedicated P2P Device
interface, as in such a case no cross connection is really possible.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 wpa_supplicant/p2p_supplicant.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Jouni Malinen June 19, 2015, 1:14 p.m. UTC | #1
On Wed, Jun 17, 2015 at 04:18:18PM +0300, Ilan Peer wrote:
> Change the conditions that allow a cross connection to allow
> all the interface shared by the same radio, and not only the parent
> interface.

The current implementation does not limit this to interfaces shared by
the same radio. Why would there be such restriction?

> diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
> @@ -6729,14 +6729,16 @@ static void wpas_p2p_cross_connect_setup(struct wpa_supplicant *wpa_s)
> -	for (iface = wpa_s->global->ifaces; iface; iface = iface->next) {
> +	dl_list_for_each(iface, &wpa_s->radio->ifaces, struct wpa_supplicant,
> +			 radio_list) {

Unless I'm missing something here, this would break the case where the
device has two radios, one for P2P and the other one for non-P2P use.
P2P cross connection should be possible with such a non-P2P station
interface on another radio.
Peer, Ilan June 21, 2015, 5:54 p.m. UTC | #2
Hi Jouni,

> -----Original Message-----
> From: Jouni Malinen [mailto:j@w1.fi]
> Sent: Friday, June 19, 2015 16:15
> To: Peer, Ilan
> Cc: hostap@lists.shmoo.com
> Subject: Re: [PATCH 6/9] P2P: Relax the conditions that allow cross-
> connection
> 
> On Wed, Jun 17, 2015 at 04:18:18PM +0300, Ilan Peer wrote:
> > Change the conditions that allow a cross connection to allow all the
> > interface shared by the same radio, and not only the parent interface.
> 
> The current implementation does not limit this to interfaces shared by the
> same radio. Why would there be such restriction?
> 
> > diff --git a/wpa_supplicant/p2p_supplicant.c
> > b/wpa_supplicant/p2p_supplicant.c @@ -6729,14 +6729,16 @@ static void
> wpas_p2p_cross_connect_setup(struct wpa_supplicant *wpa_s)
> > -	for (iface = wpa_s->global->ifaces; iface; iface = iface->next) {
> > +	dl_list_for_each(iface, &wpa_s->radio->ifaces, struct wpa_supplicant,
> > +			 radio_list) {
> 
> Unless I'm missing something here, this would break the case where the
> device has two radios, one for P2P and the other one for non-P2P use.
> P2P cross connection should be possible with such a non-P2P station
> interface on another radio.
> 

My bad ... I never practiced having a single wpa_supplicant controlling several devices :)
Will fix this so for P2P capable driver I'll iterate all the radio interfaces and not only the parent.

Thanks,

Ilan.
diff mbox

Patch

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index fa91001..e309c11 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -6729,14 +6729,16 @@  static void wpas_p2p_cross_connect_setup(struct wpa_supplicant *wpa_s)
 	if (!wpa_s->global->cross_connection)
 		return;
 
-	for (iface = wpa_s->global->ifaces; iface; iface = iface->next) {
+	dl_list_for_each(iface, &wpa_s->radio->ifaces, struct wpa_supplicant,
+			 radio_list) {
 		if (iface == wpa_s)
 			continue;
+
 		if (iface->drv_flags &
 		    WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE)
 			continue;
-		if ((iface->drv_flags & WPA_DRIVER_FLAGS_P2P_CAPABLE) &&
-		    iface != wpa_s->parent)
+
+		if (iface->p2p_mgmt)
 			continue;
 
 		wpa_s->cross_connect_enabled = 1;