Re: [PATCH v3 11/26] wpa_supplicant: udp ctrl setup ctrl_interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 17, 2016 at 01:14:14PM +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
> @@ -363,6 +363,7 @@ struct ctrl_iface_priv *
>  wpa_supplicant_ctrl_iface_init(struct wpa_supplicant *wpa_s)

> +	char port_str[40] = "udp:9877";

What is the point of setting the "udp:9877" value here?

> +	/* Setup correct ctrl_interface */
> +	os_snprintf(port_str, sizeof(port_str), "udp:%d", port);

Wouldn't this unconditionally replace that "udp:9877" value?

> +	if (wpa_s->conf->ctrl_interface)
> +		os_free(wpa_s->conf->ctrl_interface);

os_free(NULL) is fine, so please no "if (ptr)" checks before os_free()
calls.

> +	wpa_s->conf->ctrl_interface = os_strdup(port_str);

Should there be a check to verify that os_strdup() succeeds here?

-- 
Jouni Malinen                                            PGP id EFC895FA

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux