From: Jouni Malinen Date: Thu, 4 Jun 2020 18:04:59 +0000 (+0300) Subject: WPS UPnP: Do not update Beacon frames unnecessarily on subscription removal X-Git-Tag: hostap_2_10~1218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40240735bd6731fc00dd1b3ad0a7d1722bf706bc;p=thirdparty%2Fhostap.git WPS UPnP: Do not update Beacon frames unnecessarily on subscription removal There is no need to update the WPS IE in Beacon frames when a subscription is removed if that subscription is not for an actual selected registrar. For example, this gets rids of unnecessary driver operations when a subscription request gets rejected when parsing the callback URLs. Signed-off-by: Jouni Malinen --- diff --git a/src/wps/wps_upnp_ap.c b/src/wps/wps_upnp_ap.c index cca390530..b6c9478ff 100644 --- a/src/wps/wps_upnp_ap.c +++ b/src/wps/wps_upnp_ap.c @@ -76,8 +76,10 @@ int upnp_er_set_selected_registrar(struct wps_registrar *reg, void upnp_er_remove_notification(struct wps_registrar *reg, struct subscription *s) { + bool was_sel_reg = s->selected_registrar; + s->selected_registrar = 0; eloop_cancel_timeout(upnp_er_set_selected_timeout, s, reg); - if (reg) + if (reg && was_sel_reg) wps_registrar_selected_registrar_changed(reg, 0); }