aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/ctrl_iface.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-07-25 16:52:27 (GMT)
committerJouni Malinen <j@w1.fi>2015-07-25 16:52:27 (GMT)
commitff7a4bd13fe4a0058c5b865d390a7d57646a8d1e (patch)
tree1f3aec4c4a16fd41dd0b82bc4bff4ae89cf5e087 /hostapd/ctrl_iface.c
parentceb8a79c33fe3d29bda2e9530663f7a4c22105b9 (diff)
downloadhostap-ff7a4bd13fe4a0058c5b865d390a7d57646a8d1e.zip
hostap-ff7a4bd13fe4a0058c5b865d390a7d57646a8d1e.tar.gz
hostap-ff7a4bd13fe4a0058c5b865d390a7d57646a8d1e.tar.bz2
FST: Do not replace previous attachment
hapd->iface->fst must not be overridden if it is already pointing to FST instance. Without this, duplicated FST-ATTACH could result in memory leak and process termination. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'hostapd/ctrl_iface.c')
-rw-r--r--hostapd/ctrl_iface.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index aa80353..d2c78ca 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -2578,6 +2578,10 @@ hostapd_global_ctrl_iface_fst_attach(struct hapd_interfaces *interfaces,
if (!fst_parse_attach_command(cmd, ifname, sizeof(ifname), &cfg)) {
hapd = hostapd_get_iface(interfaces, ifname);
if (hapd) {
+ if (hapd->iface->fst) {
+ wpa_printf(MSG_INFO, "FST: Already attached");
+ return -1;
+ }
fst_hostapd_fill_iface_obj(hapd, &iface_obj);
hapd->iface->fst = fst_attach(ifname, hapd->own_addr,
&iface_obj, &cfg);