From f55430863282b5da91d247a42d7fd15a785f4eab Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 16 May 2018 16:22:42 +0200 Subject: [PATCH] fix warnings and remove debug output --- lib/src/upper/rlc.cc | 4 ++-- srsue/src/upper/gw.cc | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/src/upper/rlc.cc b/lib/src/upper/rlc.cc index cdd19ad46..5b26add1b 100644 --- a/lib/src/upper/rlc.cc +++ b/lib/src/upper/rlc.cc @@ -332,7 +332,7 @@ void rlc::add_bearer(uint32_t lcid, srslte_rlc_config_t cnfg) void rlc::add_bearer_mrb(uint32_t lcid) { // 36.321 Table 6.2.1-4 - if(lcid < 0 || lcid >= SRSLTE_N_MCH_LCIDS) { + if(lcid >= SRSLTE_N_MCH_LCIDS) { rlc_log->error("Radio bearer id must be in [0:%d] - %d\n", SRSLTE_N_MCH_LCIDS, lcid); return; } @@ -366,7 +366,7 @@ bool rlc::valid_lcid(uint32_t lcid) bool rlc::valid_lcid_mrb(uint32_t lcid) { - if(lcid < 0 || lcid > 31) { + if(lcid >= SRSLTE_N_MCH_LCIDS) { return false; } if(!rlc_array_mrb[lcid].is_mrb()) { diff --git a/srsue/src/upper/gw.cc b/srsue/src/upper/gw.cc index 4b032e136..3d91791b2 100644 --- a/srsue/src/upper/gw.cc +++ b/srsue/src/upper/gw.cc @@ -150,7 +150,7 @@ void gw::write_pdu_mch(uint32_t lcid, srslte::byte_buffer_t *pdu) { if(pdu->N_bytes>2) { - gw_log->info_hex(pdu->msg, pdu->N_bytes, "RX MCH PDU. Stack latency: %ld us\n", pdu->get_latency_us()); + gw_log->info_hex(pdu->msg, pdu->N_bytes, "RX MCH PDU (%d B). Stack latency: %ld us\n", pdu->N_bytes, pdu->get_latency_us()); dl_tput_bytes += pdu->N_bytes; //Hack to drop initial 2 bytes @@ -158,9 +158,7 @@ void gw::write_pdu_mch(uint32_t lcid, srslte::byte_buffer_t *pdu) pdu->N_bytes-=2; struct in_addr dst_addr; memcpy(&dst_addr.s_addr, &pdu->msg[16],4); - gw_log->console("gw\n"); - gw_log->console("Destination IP: %s\n",inet_ntoa(dst_addr)); - srslte_vec_fprint_b(stdout,&pdu->msg[0], pdu->N_bytes); + if(!if_up) { gw_log->warning("TUN/TAP not up - dropping gw RX message\n");