From ae4cfb50f2d8e7121ffd7a4ac7d01d66757438cd Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 3 Mar 2020 15:25:53 +0100 Subject: [PATCH] print warning to console if TUN interface couldn't be setup --- srsue/hdr/stack/upper/nas.h | 2 ++ srsue/src/stack/upper/nas.cc | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/srsue/hdr/stack/upper/nas.h b/srsue/hdr/stack/upper/nas.h index bc4dd26f4..5743b3c27 100644 --- a/srsue/hdr/stack/upper/nas.h +++ b/srsue/hdr/stack/upper/nas.h @@ -306,6 +306,8 @@ private: srslte::proc_manager_list_t callbacks; srslte::proc_t plmn_searcher; srslte::proc_t rrc_connector; + + const std::string gw_setup_failure_str = "Failed to setup/configure GW interface"; }; } // namespace srsue diff --git a/srsue/src/stack/upper/nas.cc b/srsue/src/stack/upper/nas.cc index f24ec5ad1..a0942ab64 100644 --- a/srsue/src/stack/upper/nas.cc +++ b/srsue/src/stack/upper/nas.cc @@ -958,7 +958,8 @@ void nas::parse_attach_accept(uint32_t lcid, unique_byte_buffer_t pdu) ip_addr, nullptr, err_str)) { - nas_log->error("Failed to set gateway address - %s\n", err_str); + nas_log->error("%s - %s\n", gw_setup_failure_str.c_str(), err_str); + nas_log->console("%s\n", gw_setup_failure_str.c_str()); } } else if (LIBLTE_MME_PDN_TYPE_IPV6 == act_def_eps_bearer_context_req.pdn_addr.pdn_type) { memcpy(ipv6_if_id, act_def_eps_bearer_context_req.pdn_addr.addr, 8); @@ -989,7 +990,8 @@ void nas::parse_attach_accept(uint32_t lcid, unique_byte_buffer_t pdu) 0, ipv6_if_id, err_str)) { - nas_log->error("Failed to set gateway address - %s\n", err_str); + nas_log->error("%s - %s\n", gw_setup_failure_str.c_str(), err_str); + nas_log->console("%s\n", gw_setup_failure_str.c_str()); } } else if (LIBLTE_MME_PDN_TYPE_IPV4V6 == act_def_eps_bearer_context_req.pdn_addr.pdn_type) { memcpy(ipv6_if_id, act_def_eps_bearer_context_req.pdn_addr.addr, 8); @@ -1038,7 +1040,8 @@ void nas::parse_attach_accept(uint32_t lcid, unique_byte_buffer_t pdu) ip_addr, ipv6_if_id, err_str)) { - nas_log->error("Failed to set gateway address - %s\n", err_str); + nas_log->error("%s - %s\n", gw_setup_failure_str.c_str(), err_str); + nas_log->console("%s\n", gw_setup_failure_str.c_str()); } } else { nas_log->error("PDN type not IPv4, IPv6 nor IPv4v6\n");