@@ -109,6 +109,7 @@ static int8_t ws_pae_controller_nw_key_check_and_insert(protocol_interface_info_
109
109
static void ws_pae_controller_active_nw_key_clear (nw_key_t * nw_key );
110
110
static void ws_pae_controller_active_nw_key_set (protocol_interface_info_entry_t * cur , uint8_t index );
111
111
static int8_t ws_pae_controller_gak_from_gtk (uint8_t * gak , uint8_t * gtk , char * network_name );
112
+ static void ws_pae_controller_frame_counter_store_and_nw_keys_remove (protocol_interface_info_entry_t * interface_ptr , pae_controller_t * controller , bool use_threshold );
112
113
static void ws_pae_controller_nw_key_index_check_and_set (protocol_interface_info_entry_t * interface_ptr , uint8_t index );
113
114
static void ws_pae_controller_data_init (pae_controller_t * controller );
114
115
static void ws_pae_controller_frame_counter_read (pae_controller_t * controller );
@@ -477,8 +478,15 @@ void ws_pae_controller_nw_keys_remove(protocol_interface_info_entry_t *interface
477
478
return ;
478
479
}
479
480
481
+ /* Stores frame counters if incremented by threshold and removes network keys from PAE
482
+ controller and MAC */
483
+ ws_pae_controller_frame_counter_store_and_nw_keys_remove (interface_ptr , controller , true);
484
+ }
485
+
486
+ static void ws_pae_controller_frame_counter_store_and_nw_keys_remove (protocol_interface_info_entry_t * interface_ptr , pae_controller_t * controller , bool use_threshold )
487
+ {
480
488
/* Checks if frame counters needs to be stored when keys are removed */
481
- ws_pae_controller_frame_counter_store (controller , true );
489
+ ws_pae_controller_frame_counter_store (controller , use_threshold );
482
490
483
491
tr_info ("NW keys remove" );
484
492
@@ -703,8 +711,8 @@ int8_t ws_pae_controller_stop(protocol_interface_info_entry_t *interface_ptr)
703
711
return -1 ;
704
712
}
705
713
706
- // Removes network keys from PAE controller and MAC
707
- ws_pae_controller_nw_keys_remove (interface_ptr );
714
+ // Stores frame counters and removes network keys from PAE controller and MAC
715
+ ws_pae_controller_frame_counter_store_and_nw_keys_remove (interface_ptr , controller , false );
708
716
709
717
// If PAE has been initialized, deletes it
710
718
if (controller -> pae_delete ) {
0 commit comments