diff mbox

[05/16] P2P: Send M2D event on the global control interface

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

Commit Message

Peer, Ilan June 17, 2015, 1:24 p.m. UTC
As this is not an interface specific event, and the P2P
related events should be sent on the global control interface.

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

Comments

Jouni Malinen June 19, 2015, 7:49 a.m. UTC | #1
On Wed, Jun 17, 2015 at 04:24:51PM +0300, Ilan Peer wrote:
> As this is not an interface specific event, and the P2P
> related events should be sent on the global control interface.

> diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
> @@ -584,7 +584,8 @@ static void wpa_supplicant_wps_event_m2d(struct wpa_supplicant *wpa_s,
>  	wpas_notify_wps_event_m2d(wpa_s, m2d);
>  #ifdef CONFIG_P2P
>  	if (wpa_s->parent && wpa_s->parent != wpa_s) {
> -		wpa_msg(wpa_s->parent, MSG_INFO, WPS_EVENT_M2D
> +		wpa_msg_global(wpa_s->global->p2p_init_wpa_s,
> +			       MSG_INFO, WPS_EVENT_M2D
>  			"dev_password_id=%d config_error=%d",
>  			m2d->dev_password_id, m2d->config_error);

Couldn't this break some existing uses? As an example, wlan0 could be
used to manage P2P operations and when a separate group interface is
used, the WPS-M2D event used to go out on that group interface's
ctrl_iface and wlan0 interface's ctrl_iface. With this change, that
latter would not happen and if an upper layer application was only
registered for events on wlan0, it would not see this new global event.
Peer, Ilan June 21, 2015, 1:41 p.m. UTC | #2
Hi Jouni,

> -----Original Message-----
> From: Jouni Malinen [mailto:j@w1.fi]
> Sent: Friday, June 19, 2015 10:49
> To: Peer, Ilan
> Cc: hostap@lists.shmoo.com
> Subject: Re: [PATCH 05/16] P2P: Send M2D event on the global control
> interface
> 
> On Wed, Jun 17, 2015 at 04:24:51PM +0300, Ilan Peer wrote:
> > As this is not an interface specific event, and the P2P related events
> > should be sent on the global control interface.
> 
> > diff --git a/wpa_supplicant/wps_supplicant.c
> > b/wpa_supplicant/wps_supplicant.c @@ -584,7 +584,8 @@ static void
> wpa_supplicant_wps_event_m2d(struct wpa_supplicant *wpa_s,
> >  	wpas_notify_wps_event_m2d(wpa_s, m2d);  #ifdef CONFIG_P2P
> >  	if (wpa_s->parent && wpa_s->parent != wpa_s) {
> > -		wpa_msg(wpa_s->parent, MSG_INFO, WPS_EVENT_M2D
> > +		wpa_msg_global(wpa_s->global->p2p_init_wpa_s,
> > +			       MSG_INFO, WPS_EVENT_M2D
> >  			"dev_password_id=%d config_error=%d",
> >  			m2d->dev_password_id, m2d->config_error);
> 
> Couldn't this break some existing uses? As an example, wlan0 could be used
> to manage P2P operations and when a separate group interface is used, the
> WPS-M2D event used to go out on that group interface's ctrl_iface and wlan0
> interface's ctrl_iface. With this change, that latter would not happen and if an
> upper layer application was only registered for events on wlan0, it would not
> see this new global event.
> 

Yes, this would break this use case your described. However, in the case of a dedicated P2P Device interface the only alternative is to use the global control interface (and with higher layer applications that use the global control interface for P2P operations should really also listen on it for the events).

Would you consider a solution that fires the event on both the parent interface and the global interface as a valid one? 

Regards,

Ilan.
diff mbox

Patch

diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index a97c2a8..6f770b9 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -584,7 +584,8 @@  static void wpa_supplicant_wps_event_m2d(struct wpa_supplicant *wpa_s,
 	wpas_notify_wps_event_m2d(wpa_s, m2d);
 #ifdef CONFIG_P2P
 	if (wpa_s->parent && wpa_s->parent != wpa_s) {
-		wpa_msg(wpa_s->parent, MSG_INFO, WPS_EVENT_M2D
+		wpa_msg_global(wpa_s->global->p2p_init_wpa_s,
+			       MSG_INFO, WPS_EVENT_M2D
 			"dev_password_id=%d config_error=%d",
 			m2d->dev_password_id, m2d->config_error);
 	}