aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>2016-03-04 09:20:28 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-05 15:44:49 (GMT)
commit180e5b96c3c880296292558342760be0530b90db (patch)
tree54f474e0f7a94749b404b35126b5c041bc1f6889
parent56e2fc2c31aa36ccc60e87868365f3f36ebbb42b (diff)
downloadhostap-180e5b96c3c880296292558342760be0530b90db.zip
hostap-180e5b96c3c880296292558342760be0530b90db.tar.gz
hostap-180e5b96c3c880296292558342760be0530b90db.tar.bz2
hostapd: Update ctrl_interface for UDP to include the selected port
Set up the real ctrl_interface for UDP after having selected the port. This is in format: udp:<port_no>. This is needed to get accurate interface <-> udp_port mapping. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
-rw-r--r--hostapd/ctrl_iface.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 9c388b2..b54d013 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -2444,6 +2444,7 @@ int hostapd_ctrl_iface_init(struct hostapd_data *hapd)
#ifdef CONFIG_CTRL_IFACE_UDP
int port = HOSTAPD_CTRL_IFACE_PORT;
char p[32] = { 0 };
+ char port_str[40], *tmp;
char *pos;
struct addrinfo hints = { 0 }, *res, *saveres;
int n;
@@ -2508,6 +2509,12 @@ try_again:
freeaddrinfo(saveres);
+ os_snprintf(port_str, sizeof(port_str), "udp:%d", port);
+ tmp = os_strdup(port_str);
+ if (tmp) {
+ os_free(hapd->conf->ctrl_interface);
+ hapd->conf->ctrl_interface = tmp;
+ }
wpa_printf(MSG_DEBUG, "ctrl_iface_init UDP port: %d", port);
if (eloop_register_read_sock(hapd->ctrl_sock,