aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-11-21 20:00:33 (GMT)
committerJouni Malinen <j@w1.fi>2009-11-22 19:43:25 (GMT)
commit2ad8bc7e289a7a9ca84e1e3372a1d67c376ce965 (patch)
tree4a2e9082b044a1ede86ca9853cf988dd24942eed
parent42a5a6125071e9373bad5d6680dfb53439ecccb4 (diff)
downloadhostap-06-2ad8bc7e289a7a9ca84e1e3372a1d67c376ce965.zip
hostap-06-2ad8bc7e289a7a9ca84e1e3372a1d67c376ce965.tar.gz
hostap-06-2ad8bc7e289a7a9ca84e1e3372a1d67c376ce965.tar.bz2
WPS: Do not try to send byebye advertisements if socket is not valid
If initialization fails, we could potentially try to sendto() on -1 socket which would fail. No point in doing that, so just return early from the function. (cherry picked from commit 3c2166d63c3f8db9699bd29b152121ca63c70415)
-rw-r--r--src/wps/wps_upnp_ssdp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wps/wps_upnp_ssdp.c b/src/wps/wps_upnp_ssdp.c
index b594e20..c1dc99d 100644
--- a/src/wps/wps_upnp_ssdp.c
+++ b/src/wps/wps_upnp_ssdp.c
@@ -240,7 +240,7 @@ void advertisement_state_machine_stop(struct upnp_wps_device_sm *sm,
struct sockaddr_in dest;
eloop_cancel_timeout(advertisement_state_machine_handler, NULL, sm);
- if (!send_byebye)
+ if (!send_byebye || sm->multicast_sd < 0)
return;
a->type = ADVERTISE_DOWN;