aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-03-04 09:42:15 (GMT)
committerJouni Malinen <j@w1.fi>2017-03-04 09:42:15 (GMT)
commitd4359923e1ea8bd618da51ce527f57c94b73c35b (patch)
tree0a824678587d65e04b3ad5da4e97d212d97802c9 /src
parent6baab31c6c9ee78041441ae252364ffc24cb0429 (diff)
downloadhostap-d4359923e1ea8bd618da51ce527f57c94b73c35b.zip
hostap-d4359923e1ea8bd618da51ce527f57c94b73c35b.tar.gz
hostap-d4359923e1ea8bd618da51ce527f57c94b73c35b.tar.bz2
Fix DHCP/NDISC snoop deinit followed by failing re-init
It was possible to hit a double-free on the l2_packet socket if initialization of DHCP/NDISC snoop failed on a hostapd interface that had previously had those enabled successfully. Fix this by clearing the l2_packet pointers during deinit. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/ap/dhcp_snoop.c1
-rw-r--r--src/ap/ndisc_snoop.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/ap/dhcp_snoop.c b/src/ap/dhcp_snoop.c
index b9a36d7..6d8c2f4 100644
--- a/src/ap/dhcp_snoop.c
+++ b/src/ap/dhcp_snoop.c
@@ -154,4 +154,5 @@ int dhcp_snoop_init(struct hostapd_data *hapd)
void dhcp_snoop_deinit(struct hostapd_data *hapd)
{
l2_packet_deinit(hapd->sock_dhcp);
+ hapd->sock_dhcp = NULL;
}
diff --git a/src/ap/ndisc_snoop.c b/src/ap/ndisc_snoop.c
index 3c086bf..4d6a92e 100644
--- a/src/ap/ndisc_snoop.c
+++ b/src/ap/ndisc_snoop.c
@@ -182,4 +182,5 @@ int ndisc_snoop_init(struct hostapd_data *hapd)
void ndisc_snoop_deinit(struct hostapd_data *hapd)
{
l2_packet_deinit(hapd->sock_ndisc);
+ hapd->sock_ndisc = NULL;
}