[PATCH v5 10/25] wpa_supplicant: udp ctrl setup ctrl_interface
Janusz Dziedzic
janusz.dziedzic at tieto.com
Sun Mar 6 03:00:35 PST 2016
On 5 March 2016 at 14:43, Jouni Malinen <j at w1.fi> wrote:
> On Fri, Mar 04, 2016 at 10:20:26AM +0100, Janusz Dziedzic wrote:
>> Setup ctrl_interface name. This should be used
>> to check interface <-> udp port assigment.
>
>> diff --git a/wpa_supplicant/ctrl_iface_udp.c b/wpa_supplicant/ctrl_iface_udp.c
>> @@ -380,10 +381,8 @@ wpa_supplicant_ctrl_iface_init(struct wpa_supplicant *wpa_s)
>> priv->sock = -1;
>> os_get_random(priv->cookie, COOKIE_LEN);
>>
>> - if (wpa_s->conf->ctrl_interface == NULL)
>> - return priv;
>> -
>> - pos = os_strstr(wpa_s->conf->ctrl_interface, "udp:");
>> + if (wpa_s->conf->ctrl_interface)
>> + pos = os_strstr(wpa_s->conf->ctrl_interface, "udp:");
>
> Could you please clarify what this is trying to do? This would end up
> opening the control interface socket even if the configuration has the
> control interface disabled (wpa_s->conf->ctrl_interface == NULL). That
> does not sound correct and the commit message is not very clear on the
> purpose of this change.
>
Added this check while strstr() segfault when NULL passed.
But yes, I added this because p2p_group_add() failed (ctrl_interface
derived from main in such case).
Will split/describe this better and resend.
BR
Janusz
> --
> Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list