diff mbox

[v3,12/26] wpa_supplicant: udp ctrl show when ITERFACES cmd

Message ID 1455711269-12929-13-git-send-email-janusz.dziedzic@tieto.com
State Changes Requested
Headers show

Commit Message

Janusz.Dziedzic@tieto.com Feb. 17, 2016, 12:14 p.m. UTC
Show udp port when handle INTERFACES command.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
 wpa_supplicant/ctrl_iface.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Jouni Malinen Feb. 20, 2016, 3:26 p.m. UTC | #1
On Wed, Feb 17, 2016 at 01:14:15PM +0100, Janusz Dziedzic wrote:
> Show udp port when handle INTERFACES command.

> diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
> @@ -9233,7 +9233,12 @@ static int wpa_supplicant_global_iface_interfaces(struct wpa_global *global,
> +#ifdef CONFIG_CTRL_IFACE_UDP
> +		res = os_snprintf(pos, end - pos, "%s ctrl_iface=%s\n",
> +				  wpa_s->ifname, wpa_s->conf->ctrl_interface);
> +#else
>  		res = os_snprintf(pos, end - pos, "%s\n", wpa_s->ifname);
> +#endif

Wouldn't this break all existing expectations on INTERFACES command
output format? It does not look good to return different values based on
which control interface backend is used.
Janusz.Dziedzic@tieto.com Feb. 21, 2016, 12:48 p.m. UTC | #2
On 20 February 2016 at 16:26, Jouni Malinen <j@w1.fi> wrote:
> On Wed, Feb 17, 2016 at 01:14:15PM +0100, Janusz Dziedzic wrote:
>> Show udp port when handle INTERFACES command.
>
>> diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
>> @@ -9233,7 +9233,12 @@ static int wpa_supplicant_global_iface_interfaces(struct wpa_global *global,
>> +#ifdef CONFIG_CTRL_IFACE_UDP
>> +             res = os_snprintf(pos, end - pos, "%s ctrl_iface=%s\n",
>> +                               wpa_s->ifname, wpa_s->conf->ctrl_interface);
>> +#else
>>               res = os_snprintf(pos, end - pos, "%s\n", wpa_s->ifname);
>> +#endif
>
> Wouldn't this break all existing expectations on INTERFACES command
> output format? It does not look good to return different values based on
> which control interface backend is used.
>
Added this to not break hwsim command parsing. In next version I can
remove this #ifdef and fix hwsim parsing, or we can introduce new
command here?

> --
> Jouni Malinen                                            PGP id EFC895FA
Janusz.Dziedzic@tieto.com Feb. 21, 2016, 5:11 p.m. UTC | #3
On 21 February 2016 at 13:48, Janusz Dziedzic <janusz.dziedzic@tieto.com> wrote:
> On 20 February 2016 at 16:26, Jouni Malinen <j@w1.fi> wrote:
>> On Wed, Feb 17, 2016 at 01:14:15PM +0100, Janusz Dziedzic wrote:
>>> Show udp port when handle INTERFACES command.
>>
>>> diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
>>> @@ -9233,7 +9233,12 @@ static int wpa_supplicant_global_iface_interfaces(struct wpa_global *global,
>>> +#ifdef CONFIG_CTRL_IFACE_UDP
>>> +             res = os_snprintf(pos, end - pos, "%s ctrl_iface=%s\n",
>>> +                               wpa_s->ifname, wpa_s->conf->ctrl_interface);
>>> +#else
>>>               res = os_snprintf(pos, end - pos, "%s\n", wpa_s->ifname);
>>> +#endif
>>
>> Wouldn't this break all existing expectations on INTERFACES command
>> output format? It does not look good to return different values based on
>> which control interface backend is used.
>>
> Added this to not break hwsim command parsing. In next version I can
> remove this #ifdef and fix hwsim parsing, or we can introduce new
> command here?
>
Maybe we should introduce: <INTERFACES param=ctrl> command (or
something similar)?
So, <INTERFACES> will work as before?

>> --
>> Jouni Malinen                                            PGP id EFC895FA
diff mbox

Patch

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 6829aa0..0bd5eca 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -9233,7 +9233,12 @@  static int wpa_supplicant_global_iface_interfaces(struct wpa_global *global,
 	end = buf + len;
 
 	while (wpa_s) {
+#ifdef CONFIG_CTRL_IFACE_UDP
+		res = os_snprintf(pos, end - pos, "%s ctrl_iface=%s\n",
+				  wpa_s->ifname, wpa_s->conf->ctrl_interface);
+#else
 		res = os_snprintf(pos, end - pos, "%s\n", wpa_s->ifname);
+#endif
 		if (os_snprintf_error(end - pos, res)) {
 			*pos = '\0';
 			break;