From: Ilan Peer Date: Mon, 25 Apr 2016 08:24:58 +0000 (+0300) Subject: Send CTRL-EVENT-REGDOM-CHANGE event on the parent interface X-Git-Tag: hostap_2_6~497 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b11ad34ebac7616255577729d731e6a363e8e75;p=thirdparty%2Fhostap.git Send CTRL-EVENT-REGDOM-CHANGE event on the parent interface The NL80211_CMD_WIPHY_REG_CHANGE can be handled by any of the interfaces that are currently controlled by the wpa_supplicant. However, some applications expect the REGDOM_CHANGE event to be sent on the control interface of the initially added interface (and do not expect the event on any of child interfaces). To resolve this, when processing NL80211_CMD_WIPHY_REG_CHANGE, find the highest parent in the chain, and use its control interface to emit the CTRL-EVENT-REGDOM-CHANGE event. Signed-off-by: Ilan Peer --- diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 61390335d..2b7c5540b 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -3174,7 +3174,16 @@ static void wpa_supplicant_update_channel_list( { struct wpa_supplicant *ifs; - wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_REGDOM_CHANGE "init=%s type=%s%s%s", + /* + * To allow backwards compatibility with higher level layers that + * assumed the REGDOM_CHANGE event is sent over the initially added + * interface. Find the highest parent of this interface and use it to + * send the event. + */ + for (ifs = wpa_s; ifs->parent && ifs != ifs->parent; ifs = ifs->parent) + ; + + wpa_msg(ifs, MSG_INFO, WPA_EVENT_REGDOM_CHANGE "init=%s type=%s%s%s", reg_init_str(info->initiator), reg_type_str(info->type), info->alpha2[0] ? " alpha2=" : "", info->alpha2[0] ? info->alpha2 : "");