From b801c3dd4e3da5708868544fef093167dc246283 Mon Sep 17 00:00:00 2001 From: rubund Date: Mon, 3 Dec 2018 10:36:15 +0100 Subject: [PATCH 1/5] Fix some spelling errors detected by lintian (#271) --- srsenb/src/main.cc | 2 +- srsenb/src/phy/txrx.cc | 2 +- srsenb/src/upper/rrc.cc | 4 ++-- srsenb/src/upper/s1ap.cc | 2 +- srsepc/src/main.cc | 2 +- srsepc/src/mbms-gw/mbms-gw.cc | 2 +- srsepc/src/mme/mme_gtpc.cc | 2 +- srsepc/src/mme/s1ap_ctx_mngmt_proc.cc | 2 +- srsepc/src/mme/s1ap_mngmt_proc.cc | 4 ++-- srsepc/src/mme/s1ap_nas_transport.cc | 2 +- srsue/src/mac/proc_bsr.cc | 2 +- srsue/src/main.cc | 2 +- srsue/src/phy/phch_recv.cc | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index c9cecbebd..4b129a283 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -76,7 +76,7 @@ void parse_args(all_args_t *args, int argc, char* argv[]) { ("enb.tac", bpo::value(&tac)->default_value("0x0"), "Tracking Area Code") ("enb.mcc", bpo::value(&mcc)->default_value("001"), "Mobile Country Code") ("enb.mnc", bpo::value(&mnc)->default_value("01"), "Mobile Network Code") - ("enb.mme_addr", bpo::value(&args->enb.s1ap.mme_addr)->default_value("127.0.0.1"),"IP address of MME for S1 connnection") + ("enb.mme_addr", bpo::value(&args->enb.s1ap.mme_addr)->default_value("127.0.0.1"),"IP address of MME for S1 connection") ("enb.gtp_bind_addr", bpo::value(&args->enb.s1ap.gtp_bind_addr)->default_value("192.168.3.1"), "Local IP address to bind for GTP connection") ("enb.s1c_bind_addr", bpo::value(&args->enb.s1ap.s1c_bind_addr)->default_value("192.168.3.1"), "Local IP address to bind for S1AP connection") ("enb.phy_cell_id", bpo::value(&args->enb.pci)->default_value(0), "Physical Cell Identity (PCI)") diff --git a/srsenb/src/phy/txrx.cc b/srsenb/src/phy/txrx.cc index da92ad921..b1455936e 100644 --- a/srsenb/src/phy/txrx.cc +++ b/srsenb/src/phy/txrx.cc @@ -125,7 +125,7 @@ void txrx::run_thread() srslte_timestamp_copy(&tx_time, &rx_time); srslte_timestamp_add(&tx_time, 0, HARQ_DELAY_MS*1e-3); - Debug("Settting TTI=%d, tx_mutex=%d, tx_time=%ld:%f to worker %d\n", + Debug("Setting TTI=%d, tx_mutex=%d, tx_time=%ld:%f to worker %d\n", tti, tx_worker_cnt, tx_time.full_secs, tx_time.frac_secs, worker->get_id()); diff --git a/srsenb/src/upper/rrc.cc b/srsenb/src/upper/rrc.cc index eae78d4bd..b98d3cd5d 100644 --- a/srsenb/src/upper/rrc.cc +++ b/srsenb/src/upper/rrc.cc @@ -552,7 +552,7 @@ void rrc::parse_ul_dcch(uint16_t rnti, uint32_t lcid, byte_buffer_t *pdu) if (users.count(rnti)) { users[rnti].parse_ul_dcch(lcid, pdu); } else { - rrc_log->error("Processing %s: Unkown rnti=0x%x\n", rb_id_text[lcid], rnti); + rrc_log->error("Processing %s: Unknown rnti=0x%x\n", rb_id_text[lcid], rnti); } } } @@ -576,7 +576,7 @@ void rrc::process_rl_failure(uint16_t rnti) rrc_log->info("%d Radio-Link failure detected rnti=0x%x\n", n_rfl, rnti); } } else { - rrc_log->error("Radio-Link failure detected for uknown rnti=0x%x\n", rnti); + rrc_log->error("Radio-Link failure detected for unknown rnti=0x%x\n", rnti); } } diff --git a/srsenb/src/upper/s1ap.cc b/srsenb/src/upper/s1ap.cc index e2faf83f0..18d434234 100644 --- a/srsenb/src/upper/s1ap.cc +++ b/srsenb/src/upper/s1ap.cc @@ -1038,7 +1038,7 @@ std::string s1ap::get_cause(LIBLTE_S1AP_CAUSE_STRUCT *c) cause += liblte_s1ap_causemisc_text[c->choice.misc.e]; break; default: - cause += "unkown"; + cause += "unknown"; break; } return cause; diff --git a/srsepc/src/main.cc b/srsepc/src/main.cc index b34114363..9d0681067 100644 --- a/srsepc/src/main.cc +++ b/srsepc/src/main.cc @@ -110,7 +110,7 @@ parse_args(all_args_t *args, int argc, char* argv[]) { ("mme.tac", bpo::value(&tac)->default_value("0x0"), "Tracking Area Code") ("mme.mcc", bpo::value(&mcc)->default_value("001"), "Mobile Country Code") ("mme.mnc", bpo::value(&mnc)->default_value("01"), "Mobile Network Code") - ("mme.mme_bind_addr", bpo::value(&mme_bind_addr)->default_value("127.0.0.1"), "IP address of MME for S1 connnection") + ("mme.mme_bind_addr", bpo::value(&mme_bind_addr)->default_value("127.0.0.1"), "IP address of MME for S1 connection") ("mme.dns_addr", bpo::value(&dns_addr)->default_value("8.8.8.8"), "IP address of the DNS server for the UEs") ("mme.apn", bpo::value(&mme_apn)->default_value(""), "Set Access Point Name (APN) for data services") ("hss.db_file", bpo::value(&hss_db_file)->default_value("ue_db.csv"), ".csv file that stores UE's keys") diff --git a/srsepc/src/mbms-gw/mbms-gw.cc b/srsepc/src/mbms-gw/mbms-gw.cc index bec61596b..bb7f18957 100644 --- a/srsepc/src/mbms-gw/mbms-gw.cc +++ b/srsepc/src/mbms-gw/mbms-gw.cc @@ -319,7 +319,7 @@ mbms_gw::handle_sgi_md_pdu(srslte::byte_buffer_t *msg) int n = sendto(m_m1u, msg->msg, msg->N_bytes, 0, (sockaddr *) &m_m1u_multi_addr, sizeof(struct sockaddr)); if(n<0){ - m_mbms_gw_log->console("Error writting to M1-U socket.\n"); + m_mbms_gw_log->console("Error writing to M1-U socket.\n"); } else{ m_mbms_gw_log->debug("Sent %d Bytes\n", msg->N_bytes); diff --git a/srsepc/src/mme/mme_gtpc.cc b/srsepc/src/mme/mme_gtpc.cc index 6ef0e2cbb..94ab6f24a 100644 --- a/srsepc/src/mme/mme_gtpc.cc +++ b/srsepc/src/mme/mme_gtpc.cc @@ -212,7 +212,7 @@ mme_gtpc::handle_create_session_response(srslte::gtpc_pdu *cs_resp_pdu) //Check UE Ipv4 address was allocated if(cs_resp->paa_present != true) { - m_mme_gtpc_log->error("PDN Adress Allocation not present\n"); + m_mme_gtpc_log->error("PDN Address Allocation not present\n"); return; } if(cs_resp->paa.pdn_type != srslte::GTPC_PDN_TYPE_IPV4) diff --git a/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc b/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc index 6f9da6b0d..c9d3bf0ef 100644 --- a/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc +++ b/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc @@ -177,7 +177,7 @@ s1ap_ctx_mngmt_proc::send_initial_context_setup_request(ue_emm_ctx_t *emm_ctx, struct in_addr addr; addr.s_addr = htonl(sgw_s1u_ip); - m_s1ap_log->info("Sent Intial Context Setup Request. E-RAB id %d \n",erab_ctx_req->e_RAB_ID.E_RAB_ID); + m_s1ap_log->info("Sent Initial Context Setup Request. E-RAB id %d \n",erab_ctx_req->e_RAB_ID.E_RAB_ID); m_s1ap_log->info("Initial Context -- S1-U TEID 0x%x. IP %s \n", sgw_s1u_teid,inet_ntoa(addr)); m_s1ap_log->console("Initial Context Setup Request -- eNB UE S1AP Id %d, MME UE S1AP Id %d\n",in_ctxt_req->eNB_UE_S1AP_ID.ENB_UE_S1AP_ID, in_ctxt_req->MME_UE_S1AP_ID.MME_UE_S1AP_ID); m_s1ap_log->console("Initial Context Setup Request -- E-RAB id %d\n",erab_ctx_req->e_RAB_ID.E_RAB_ID); diff --git a/srsepc/src/mme/s1ap_mngmt_proc.cc b/srsepc/src/mme/s1ap_mngmt_proc.cc index 079eca100..dbd45cdd9 100644 --- a/srsepc/src/mme/s1ap_mngmt_proc.cc +++ b/srsepc/src/mme/s1ap_mngmt_proc.cc @@ -94,8 +94,8 @@ s1ap_mngmt_proc::handle_s1_setup_request(LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRU //Check matching PLMNs if(enb_ctx.plmn!=m_s1ap->get_plmn()){ - m_s1ap_log->console("Sending S1 Setup Failure - Unkown PLMN\n"); - m_s1ap_log->warning("Sending S1 Setup Failure - Unkown PLMN\n"); + m_s1ap_log->console("Sending S1 Setup Failure - Unknown PLMN\n"); + m_s1ap_log->warning("Sending S1 Setup Failure - Unknown PLMN\n"); pack_s1_setup_failure(LIBLTE_S1AP_CAUSEMISC_UNKNOWN_PLMN,reply_buffer); } else{ diff --git a/srsepc/src/mme/s1ap_nas_transport.cc b/srsepc/src/mme/s1ap_nas_transport.cc index 1bb871fb1..661c1171a 100644 --- a/srsepc/src/mme/s1ap_nas_transport.cc +++ b/srsepc/src/mme/s1ap_nas_transport.cc @@ -2083,7 +2083,7 @@ s1ap_nas_transport::log_unhandled_attach_request_ies(const LIBLTE_MME_ATTACH_REQ } if(attach_req->additional_guti_present) { - m_s1ap_log->warning("NAS attach request: Aditional GUTI present, but not handled.\n"); + m_s1ap_log->warning("NAS attach request: Additional GUTI present, but not handled.\n"); } if(attach_req->last_visited_registered_tai_present) { diff --git a/srsue/src/mac/proc_bsr.cc b/srsue/src/mac/proc_bsr.cc index 1026bf2f1..7555aaa7f 100644 --- a/srsue/src/mac/proc_bsr.cc +++ b/srsue/src/mac/proc_bsr.cc @@ -308,7 +308,7 @@ bool bsr_proc::need_to_send_bsr_on_ul_grant(uint32_t grant_size, bsr_t *bsr) generate_bsr(bsr, 0); bsr_sz = bsr->format==LONG_BSR?3:1; if (total_data <= (int)grant_size && total_data + 1 + bsr_sz > grant_size) { - Debug("Grant is not enough to accomodate the BSR MAC CE\n"); + Debug("Grant is not enough to accommodate the BSR MAC CE\n"); } else { Debug("BSR: Including Regular BSR: grant_size=%d, total_data=%d, bsr_sz=%d\n", grant_size, total_data, bsr_sz); diff --git a/srsue/src/main.cc b/srsue/src/main.cc index 861c1ded5..c2f786026 100644 --- a/srsue/src/main.cc +++ b/srsue/src/main.cc @@ -135,7 +135,7 @@ void parse_args(all_args_t *args, int argc, char *argv[]) { ("usim.imei", bpo::value(&args->usim.imei), "USIM IMEI") ("usim.k", bpo::value(&args->usim.k), "USIM K") ("usim.pin", bpo::value(&args->usim.pin), "PIN in case real SIM card is used") - ("usim.reader", bpo::value(&args->usim.reader)->default_value(""), "Force specifiy PCSC reader. Default: Try all available readers.") + ("usim.reader", bpo::value(&args->usim.reader)->default_value(""), "Force specify PCSC reader. Default: Try all available readers.") /* Expert section */ ("expert.ip_netmask", diff --git a/srsue/src/phy/phch_recv.cc b/srsue/src/phy/phch_recv.cc index 3cac3509c..7a985b9a1 100644 --- a/srsue/src/phy/phch_recv.cc +++ b/srsue/src/phy/phch_recv.cc @@ -1616,7 +1616,7 @@ void phch_recv::intra_measure::write(uint32_t tti, cf_t *data, uint32_t nsamples } if (receiving == true) { if (srslte_ringbuffer_write(&ring_buffer, data, nsamples*sizeof(cf_t)) < (int) (nsamples*sizeof(cf_t))) { - Warning("Error writting to ringbuffer\n"); + Warning("Error writing to ringbuffer\n"); receiving = false; } else { receive_cnt++; From a9032bb91a1fcd91b2d3435114cb3bc1df8153a6 Mon Sep 17 00:00:00 2001 From: David Rupprecht Date: Tue, 11 Dec 2018 18:03:46 +0100 Subject: [PATCH 2/5] Fix problems when TA timer is set to infinity --- srsue/src/mac/demux.cc | 9 +++++---- srsue/src/mac/mac.cc | 19 +++++++++++++++---- srsue/src/mac/proc_ra.cc | 7 +++++-- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/srsue/src/mac/demux.cc b/srsue/src/mac/demux.cc index 28e17d5b0..3c656161d 100644 --- a/srsue/src/mac/demux.cc +++ b/srsue/src/mac/demux.cc @@ -245,10 +245,11 @@ bool demux::process_ce(srslte::sch_subh *subh) { case srslte::sch_subh::TA_CMD: phy_h->set_timeadv(subh->get_ta_cmd()); Info("Received TA=%d\n", subh->get_ta_cmd()); - - // Start or restart timeAlignmentTimer - time_alignment_timer->reset(); - time_alignment_timer->run(); + // Start or restart timeAlignmentTimer only if running + if (time_alignment_timer->is_running()) { + time_alignment_timer->reset(); + time_alignment_timer->run(); + } break; case srslte::sch_subh::PADDING: break; diff --git a/srsue/src/mac/mac.cc b/srsue/src/mac/mac.cc index 964e394e9..516d1d97f 100644 --- a/srsue/src/mac/mac.cc +++ b/srsue/src/mac/mac.cc @@ -64,6 +64,10 @@ bool mac::init(phy_interface_mac *phy, rlc_interface_mac *rlc, rrc_interface_mac timer_alignment = timers.get_unique_id(); contention_resolution_timer = timers.get_unique_id(); + log_h->debug("Timer Timing Alignment ID 0x%x\n", timer_alignment); + log_h->debug("Timer Contention Resolution ID 0x%x\n", + contention_resolution_timer); + bsr_procedure.init( rlc_h, log_h, &config, &timers); phr_procedure.init(phy_h, log_h, &config, &timers); mux_unit.init ( rlc_h, log_h, &bsr_procedure, &phr_procedure); @@ -364,9 +368,14 @@ void mac::setup_timers() // stop currently running time alignment timer if (timers.get(timer_alignment)->is_running()) { timers.get(timer_alignment)->stop(); + log_h->debug("Stop running MAC Time Alignment Timer with ID 0x%x\n", + timer_alignment); } - int value = liblte_rrc_time_alignment_timer_num[config.main.time_alignment_timer]; + int value = + liblte_rrc_time_alignment_timer_num[config.main.time_alignment_timer]; + log_h->info("Set MAC Time Alignment Timer (0x%x) to: %d value: %d \n", + timer_alignment, config.main.time_alignment_timer, value); if (value > 0) { timers.get(timer_alignment)->set(this, value); } @@ -382,9 +391,11 @@ void mac::timer_expired(uint32_t timer_id) } /* Function called on expiry of TimeAlignmentTimer */ -void mac::timer_alignment_expire() -{ - printf("TimeAlignment timer has expired value=%d ms\n", timers.get(timer_alignment)->get_timeout()); +void mac::timer_alignment_expire() { + log_h->console("TimeAlignment timer has expired value=%d ms\n", + timers.get(timer_alignment)->get_timeout()); + log_h->warning("TimeAlignment timer has expired value=%d ms\n", + timers.get(timer_alignment)->get_timeout()); rrc_h->release_pucch_srs(); dl_harq.reset(); ul_harq.reset(); diff --git a/srsue/src/mac/proc_ra.cc b/srsue/src/mac/proc_ra.cc index 11e53195c..8710c9e1e 100644 --- a/srsue/src/mac/proc_ra.cc +++ b/srsue/src/mac/proc_ra.cc @@ -179,8 +179,11 @@ void ra_proc::process_timeadv_cmd(uint32_t ta) { if (preambleIndex == 0) { // Preamble not selected by UE MAC phy_h->set_timeadv_rar(ta); - time_alignment_timer->reset(); - time_alignment_timer->run(); + // Only if timer is running reset the timer + if (time_alignment_timer->is_running()) { + time_alignment_timer->reset(); + time_alignment_timer->run(); + } Debug("Applying RAR TA CMD %d\n", ta); } else { // Preamble selected by UE MAC From 46d41a5dc554d4b7947ae2219a6d2d1f33b96b92 Mon Sep 17 00:00:00 2001 From: Eric Schreiber Date: Fri, 14 Dec 2018 06:01:44 -0500 Subject: [PATCH 3/5] Remove undefined increment of an erased iterator. (#274) --- lib/src/upper/pdcp.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/upper/pdcp.cc b/lib/src/upper/pdcp.cc index 93ac0cf15..0fce441ad 100644 --- a/lib/src/upper/pdcp.cc +++ b/lib/src/upper/pdcp.cc @@ -93,10 +93,10 @@ void pdcp::reset() { // destroy all bearers pthread_rwlock_wrlock(&rwlock); - for (pdcp_map_t::iterator it = pdcp_array.begin(); it != pdcp_array.end(); ++it) { + for (pdcp_map_t::iterator it = pdcp_array.begin(); it != pdcp_array.end(); /* post increment in erase */ ) { it->second->reset(); delete(it->second); - pdcp_array.erase(it); + pdcp_array.erase(it++); } pthread_rwlock_unlock(&rwlock); From 9def82d15b386ad48db53e452ff736ba762fe8a7 Mon Sep 17 00:00:00 2001 From: Igor Kim Date: Fri, 14 Dec 2018 12:02:25 +0100 Subject: [PATCH 4/5] add error handling on binding s1c socket (#267) --- srsenb/src/upper/s1ap.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/srsenb/src/upper/s1ap.cc b/srsenb/src/upper/s1ap.cc index 18d434234..ab5187a09 100644 --- a/srsenb/src/upper/s1ap.cc +++ b/srsenb/src/upper/s1ap.cc @@ -283,7 +283,10 @@ bool s1ap::connect_mme() s1ap_log->error("Error converting IP address (%s) to sockaddr_in structure\n", args.s1c_bind_addr.c_str()); return false; } - bind(socket_fd, (struct sockaddr *)&local_addr, sizeof(local_addr)); + if (bind(socket_fd, (struct sockaddr *)&local_addr, sizeof(local_addr)) != 0) { + s1ap_log->error("Failed to bind on S1-C address %s: %s errno %d\n", args.s1c_bind_addr.c_str(), strerror(errno), errno); + return false; + } // Connect to the MME address memset(&mme_addr, 0, sizeof(struct sockaddr_in)); From 652d5c59425444a31ac9700462aa87e48c825d40 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 14 Dec 2018 16:57:58 +0100 Subject: [PATCH 5/5] fix typo --- srsue/src/main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srsue/src/main.cc b/srsue/src/main.cc index b35efaa7d..07d884197 100644 --- a/srsue/src/main.cc +++ b/srsue/src/main.cc @@ -136,7 +136,7 @@ void parse_args(all_args_t *args, int argc, char *argv[]) { ("usim.imei", bpo::value(&args->usim.imei), "USIM IMEI") ("usim.k", bpo::value(&args->usim.k), "USIM K") ("usim.pin", bpo::value(&args->usim.pin), "PIN in case real SIM card is used") - ("usim.reader", bpo::value(&args->usim.reader)->default_value(""), "Force specify PCSC reader. Default: Try all available readers.") + ("usim.reader", bpo::value(&args->usim.reader)->default_value(""), "Force specific PCSC reader. Default: Try all available readers.") /* Expert section */ ("expert.ip_netmask",