@@ -152,6 +152,9 @@ void rrc_ue_impl::handle_pdu(const srb_id_t srb_id, byte_buffer rrc_pdu)
152152 case ul_dcch_msg_type_c::c1_c_::types_opts::security_mode_complete:
153153 handle_rrc_transaction_complete (ul_dcch_msg, ul_dcch_msg.msg .c1 ().security_mode_complete ().rrc_transaction_id );
154154 break ;
155+ case ul_dcch_msg_type_c::c1_c_::types_opts::security_mode_fail:
156+ handle_rrc_transaction_complete (ul_dcch_msg, ul_dcch_msg.msg .c1 ().security_mode_fail ().rrc_transaction_id );
157+ break ;
155158 case ul_dcch_msg_type_c::c1_c_::types_opts::ue_cap_info:
156159 handle_rrc_transaction_complete (ul_dcch_msg, ul_dcch_msg.msg .c1 ().ue_cap_info ().rrc_transaction_id );
157160 break ;
@@ -324,16 +327,22 @@ async_task<bool> rrc_ue_impl::handle_security_mode_command_complete_expected(uin
324327
325328 CORO_AWAIT (transaction);
326329
327- bool procedure_result = false ;
328- if (transaction.has_response ()) {
329- logger.log_debug (" Received RRC Security Mode Command Complete" );
330- procedure_result = true ;
330+ if (!transaction.has_response ()) {
331+ logger.log_debug (" Did not receive RRC Security Mode Complete. Cause: timeout" );
332+ CORO_EARLY_RETURN (false );
333+ }
334+
335+ if (transaction.response ().msg .c1 ().type () == ul_dcch_msg_type_c::c1_c_::types_opts::security_mode_fail) {
336+ logger.log_warning (" Received RRC Security Mode Failure" );
337+ CORO_EARLY_RETURN (false );
338+ }
339+
340+ if (transaction.response ().msg .c1 ().type () == ul_dcch_msg_type_c::c1_c_::types_opts::security_mode_complete) {
341+ logger.log_debug (" Received RRC Security Mode Complete" );
331342 handle_security_mode_complete (transaction.response ().msg .c1 ().security_mode_complete ());
332- } else {
333- logger.log_debug (" Did not receive RRC Security Mode Command Complete. Cause: timeout" );
334343 }
335344
336- CORO_RETURN (procedure_result );
345+ CORO_RETURN (true );
337346 });
338347}
339348
0 commit comments