From: Jouni Malinen Date: Fri, 3 Jan 2020 10:08:58 +0000 (+0200) Subject: nl80211: Simplify hapd_send_eapol() with monitor interface X-Git-Tag: hostap_2_10~2007 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14cc3d10ca1024ab0b15bdd0ad98121067a7b111;p=thirdparty%2Fhostap.git nl80211: Simplify hapd_send_eapol() with monitor interface Call nl80211_send_monitor() directly instead of going through wpa_driver_nl80211_send_frame() for the case where monitor interface is used for AP mode management purposes. drv->use_monitor has to be 1 in this code path, so wpa_driver_nl80211_send_frame() was calling nl80211_send_monitor() unconditionally for this code path and that extra function call can be removed here to simplify the implementation. Signed-off-by: Jouni Malinen --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 998b3948b..87656147b 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -5190,8 +5190,7 @@ static int wpa_driver_nl80211_hapd_send_eapol( pos += 2; memcpy(pos, data, data_len); - res = wpa_driver_nl80211_send_frame(bss, (u8 *) hdr, len, encrypt, 0, - 0, 0, 0, 0, NULL, 0); + res = nl80211_send_monitor(drv, hdr, len, encrypt, 0); if (res < 0) { wpa_printf(MSG_ERROR, "i802_send_eapol - packet len: %lu - " "failed: %d (%s)",