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>
This commit is contained in:
parent
6baab31c6c
commit
d4359923e1
2 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue