@ -15,6 +15,7 @@
# include "common/ieee802_11_defs.h"
# include "common/ieee802_11_common.h"
# include "common/wpa_ctrl.h"
# include "ap/hostapd.h"
# include "eap_peer/eap.h"
# include "eapol_supp/eapol_supp_sm.h"
# include "rsn_supp/wpa.h"
@ -420,6 +421,14 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
# ifdef CONFIG_TESTING_OPTIONS
} else if ( os_strcasecmp ( cmd , " ext_mgmt_frame_handling " ) = = 0 ) {
wpa_s - > ext_mgmt_frame_handling = ! ! atoi ( value ) ;
} else if ( os_strcasecmp ( cmd , " ext_eapol_frame_io " ) = = 0 ) {
wpa_s - > ext_eapol_frame_io = ! ! atoi ( value ) ;
# ifdef CONFIG_AP
if ( wpa_s - > ap_iface ) {
wpa_s - > ap_iface - > bss [ 0 ] - > ext_eapol_frame_io =
wpa_s - > ext_eapol_frame_io ;
}
# endif /* CONFIG_AP */
# endif /* CONFIG_TESTING_OPTIONS */
# ifndef CONFIG_NO_CONFIG_BLOBS
} else if ( os_strcmp ( cmd , " blob " ) = = 0 ) {
@ -5794,6 +5803,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
# endif /* CONFIG_INTERWORKING */
wpa_s - > ext_mgmt_frame_handling = 0 ;
wpa_s - > ext_eapol_frame_io = 0 ;
}
@ -6244,6 +6254,44 @@ static int wpas_ctrl_iface_driver_event(struct wpa_supplicant *wpa_s, char *cmd)
return 0 ;
}
static int wpas_ctrl_iface_eapol_rx ( struct wpa_supplicant * wpa_s , char * cmd )
{
char * pos ;
u8 src [ ETH_ALEN ] , * buf ;
int used ;
size_t len ;
wpa_printf ( MSG_DEBUG , " External EAPOL RX: %s " , cmd ) ;
pos = cmd ;
used = hwaddr_aton2 ( pos , src ) ;
if ( used < 0 )
return - 1 ;
pos + = used ;
while ( * pos = = ' ' )
pos + + ;
len = os_strlen ( pos ) ;
if ( len & 1 )
return - 1 ;
len / = 2 ;
buf = os_malloc ( len ) ;
if ( buf = = NULL )
return - 1 ;
if ( hexstr2bin ( pos , buf , len ) < 0 ) {
os_free ( buf ) ;
return - 1 ;
}
wpa_supplicant_rx_eapol ( wpa_s , src , buf , len ) ;
os_free ( buf ) ;
return 0 ;
}
# endif /* CONFIG_TESTING_OPTIONS */
@ -7017,6 +7065,9 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
} else if ( os_strncmp ( buf , " DRIVER_EVENT " , 13 ) = = 0 ) {
if ( wpas_ctrl_iface_driver_event ( wpa_s , buf + 13 ) < 0 )
reply_len = - 1 ;
} else if ( os_strncmp ( buf , " EAPOL_RX " , 9 ) = = 0 ) {
if ( wpas_ctrl_iface_eapol_rx ( wpa_s , buf + 9 ) < 0 )
reply_len = - 1 ;
# endif /* CONFIG_TESTING_OPTIONS */
} else if ( os_strncmp ( buf , " VENDOR_ELEM_ADD " , 16 ) = = 0 ) {
if ( wpas_ctrl_vendor_elem_add ( wpa_s , buf + 16 ) < 0 )