[PATCH 1/1] P2P: when p2p_group_add fails, remove only deinit iface

Jouni Malinen j
Sun Mar 1 13:15:32 PST 2015


On Wed, Jun 04, 2014 at 08:03:58AM -0400, Eduardo Abinader wrote:
> On Sat, May 31, 2014 at 5:56 AM, Jouni Malinen <j at w1.fi> wrote:
> > On Wed, May 28, 2014 at 03:51:07PM -0400, Eduardo Abinader wrote:
> >> diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
> >> @@ -3777,7 +3777,7 @@ static void wpa_supplicant_deinit_iface(struct wpa_supplicant *wpa_s,
> >>       if (wpa_s == wpa_s->parent)
> >> -             wpas_p2p_group_remove(wpa_s, "*");
> >> +             wpas_p2p_group_remove(wpa_s, wpa_s->ifname);
> >
> > Hmm.. This looks a bit odd. That wpa_s == wpa_s->parent condition would
> > indicate that there is no separate group interface in use and as such,
> > there cannot be multiple P2P group instances if this comes from
> > p2p_group_add failure. As such, removing all groups should remove just
> > the failing group in case this comes from p2p_group_add failure.

The issue here was in wpa_s->parent not getting yet assigned on the init
error path.

> > Could you please share a debug log showing issues with this for
> > p2p_group_add failure?
> 
> Here the logs for p2p_group_add failure: http://pastebin.com/U28azbKu
> 
> I have called p2p_group_add 4 times:
> 1) p2p_group_add --> Adds a p2p_go intf
> 2) p2p_group_add --> Remove all (even the previous one)

I reproduced this and fixed this by changing wpa_s initialization path
to assign the wpa_s->parent pointer as part of the allocation so that
the wpa_s->parent comparison in deinit_iface works properly.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list