diff mbox

Error while enabling AP using wpa_supplicant

Message ID CAFC8iJ+d8+ooR8NnjKfKAE_2E5mHzdvC2U5P2Jhx76vcEWeeQw@mail.gmail.com
State Superseded
Headers show

Commit Message

Jose Blanquicet Jan. 30, 2017, 4:09 p.m. UTC
Hi Dedy,

On Mon, Jan 30, 2017 at 3:07 PM, Lansky, Dedy wrote:
> Sorry for the late reply. I was on vacation.

Don't worry.

> It seems in your case, device_ap_sme is enabled.
> With that, nl80211_mgmt_subscribe_ap_dev_sme() is called and with previous code there is no beacon registration.
> After the patch, beacon registration is called unconditionally.
>
> I think we need to restrict the call to nl80211_get_wiphy_data_ap() by changing this line:
>
>         if (nl80211_get_wiphy_data_ap(bss) == NULL)
> into:
>         if (!drv->device_ap_sme && !drv->use_monitor && nl80211_get_wiphy_data_ap(bss) == NULL)
>
> Would appreciate if you can test this on your setup.

I tried what you suggested and it worked for me:


What does Jouni think about this solution?

Regards,

Jose Blanquicet

Comments

Jouni Malinen Feb. 3, 2017, 12:09 p.m. UTC | #1
On Mon, Jan 30, 2017 at 04:09:01PM +0000, Jose Blanquicet wrote:
> I tried what you suggested and it worked for me:
> 
> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> index 6080079..5470312 100644
> --- a/src/drivers/driver_nl80211.c
> +++ b/src/drivers/driver_nl80211.c
> @@ -3783,7 +3783,8 @@ static int wpa_driver_nl80211_set_ap(void *priv,
>                    beacon_set);
>         if (beacon_set)
>                 cmd = NL80211_CMD_SET_BEACON;
> -       else if (!nl80211_get_wiphy_data_ap(bss))
> +       else if (!drv->device_ap_sme && !drv->use_monitor &&
> +                               !nl80211_get_wiphy_data_ap(bss))
>                 return -ENOBUFS;
> 
>         wpa_hexdump(MSG_DEBUG, "nl80211: Beacon head",
> 
> What does Jouni think about this solution?

This looks like the correct thing to do here.
nl80211_get_wiphy_data_ap() used to be called from
nl80211_mgmt_subscribe_ap() and that function is within that same
!device_ap_sme && !use_monitor case.

Could you please send this patch with a proper commit message and
Signed-off-by: line so that I can apply it?
Jose Blanquicet Feb. 3, 2017, 12:47 p.m. UTC | #2
On Fri, Feb 3, 2017 at 12:09 PM, Jouni Malinen wrote:
> On Mon, Jan 30, 2017 at 04:09:01PM +0000, Jose Blanquicet wrote:
>> I tried what you suggested and it worked for me:
>>
>> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
>> index 6080079..5470312 100644
>> --- a/src/drivers/driver_nl80211.c
>> +++ b/src/drivers/driver_nl80211.c
>> @@ -3783,7 +3783,8 @@ static int wpa_driver_nl80211_set_ap(void *priv,
>>                    beacon_set);
>>         if (beacon_set)
>>                 cmd = NL80211_CMD_SET_BEACON;
>> -       else if (!nl80211_get_wiphy_data_ap(bss))
>> +       else if (!drv->device_ap_sme && !drv->use_monitor &&
>> +                               !nl80211_get_wiphy_data_ap(bss))
>>                 return -ENOBUFS;
>>
>>         wpa_hexdump(MSG_DEBUG, "nl80211: Beacon head",
>>
>> What does Jouni think about this solution?
>
> This looks like the correct thing to do here.
> nl80211_get_wiphy_data_ap() used to be called from
> nl80211_mgmt_subscribe_ap() and that function is within that same
> !device_ap_sme && !use_monitor case.
>
> Could you please send this patch with a proper commit message and
> Signed-off-by: line so that I can apply it?

It would not be a problem at all but due to I just followed Lansky's
suggestion, I was wondering if maybe he would prefer to do it himself.
Lansky, would you?

Regards,

Jose Blanquicet
Lansky, Dedy Feb. 5, 2017, 11:57 a.m. UTC | #3
Hi Jouni,

See attached patch to fix this issue.

Thanks,
 Dedy.

-----Original Message-----
From: Jose Blanquicet [mailto:blanquicet@gmail.com] 

Sent: Friday, February 3, 2017 2:47 PM
To: Lansky, Dedy <dlansky@qti.qualcomm.com>
Cc: Jouni Malinen <j@w1.fi>; MANIEZZO Marco (MM) <marco.maniezzo@magnetimarelli.com>; hostap@lists.infradead.org; Masashi Honma <masashi.honma@gmail.com>; qca_dlansky <qca_dlansky@qca.qualcomm.com>
Subject: Re: Error while enabling AP using wpa_supplicant

On Fri, Feb 3, 2017 at 12:09 PM, Jouni Malinen wrote:
> On Mon, Jan 30, 2017 at 04:09:01PM +0000, Jose Blanquicet wrote:

>> I tried what you suggested and it worked for me:

>>

>> diff --git a/src/drivers/driver_nl80211.c 

>> b/src/drivers/driver_nl80211.c index 6080079..5470312 100644

>> --- a/src/drivers/driver_nl80211.c

>> +++ b/src/drivers/driver_nl80211.c

>> @@ -3783,7 +3783,8 @@ static int wpa_driver_nl80211_set_ap(void *priv,

>>                    beacon_set);

>>         if (beacon_set)

>>                 cmd = NL80211_CMD_SET_BEACON;

>> -       else if (!nl80211_get_wiphy_data_ap(bss))

>> +       else if (!drv->device_ap_sme && !drv->use_monitor &&

>> +                               !nl80211_get_wiphy_data_ap(bss))

>>                 return -ENOBUFS;

>>

>>         wpa_hexdump(MSG_DEBUG, "nl80211: Beacon head",

>>

>> What does Jouni think about this solution?

>

> This looks like the correct thing to do here.

> nl80211_get_wiphy_data_ap() used to be called from

> nl80211_mgmt_subscribe_ap() and that function is within that same 

> !device_ap_sme && !use_monitor case.

>

> Could you please send this patch with a proper commit message and

> Signed-off-by: line so that I can apply it?


It would not be a problem at all but due to I just followed Lansky's suggestion, I was wondering if maybe he would prefer to do it himself.
Lansky, would you?

Regards,

Jose Blanquicet
Jouni Malinen Feb. 5, 2017, 10:07 p.m. UTC | #4
On Sun, Feb 05, 2017 at 11:57:32AM +0000, Lansky, Dedy wrote:
> See attached patch to fix this issue.

Thanks, applied.
diff mbox

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 6080079..5470312 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3783,7 +3783,8 @@  static int wpa_driver_nl80211_set_ap(void *priv,
                   beacon_set);
        if (beacon_set)
                cmd = NL80211_CMD_SET_BEACON;
-       else if (!nl80211_get_wiphy_data_ap(bss))
+       else if (!drv->device_ap_sme && !drv->use_monitor &&
+                               !nl80211_get_wiphy_data_ap(bss))
                return -ENOBUFS;

        wpa_hexdump(MSG_DEBUG, "nl80211: Beacon head",