[PATCH v2 13/22] hostapd: setup real ctrl_interface for UDP

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

 



Setup real ctrl_interface for UDP. This is
in format:
udp:<port_no>
This is required to get iface <-> udp_port
mapping.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@xxxxxxxxx>
---
 hostapd/ctrl_iface.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 951854e..5ba01c3 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -2367,6 +2367,7 @@ int hostapd_ctrl_iface_init(struct hostapd_data *hapd)
 {
 	int port = HOSTAPD_CTRL_IFACE_PORT;
 	char p[32]={0};
+	char port_str[40];
 	char *pos;
 	struct addrinfo hints = { 0 }, *res, *saveres;
 	int n;
@@ -2430,6 +2431,9 @@ try_again:
 
 	freeaddrinfo(saveres);
 
+	os_snprintf(port_str, sizeof(port_str), "udp:%d", port);
+	os_free(hapd->conf->ctrl_interface);
+	hapd->conf->ctrl_interface = os_strdup(port_str);
 	wpa_printf(MSG_DEBUG, "ctrl_iface_init UDP port: %d", port);
 
 	if (eloop_register_read_sock(hapd->ctrl_sock, hostapd_ctrl_iface_receive, hapd, NULL) < 0) {
-- 
1.9.1


_______________________________________________
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