neels has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36141?usp=email )
Change subject: improve HNBAP error logging
......................................................................
improve HNBAP error logging
We have a situation where HNBAP is not answered by osmo-hnbgw, and the
log is all silent. Add logging to a lot more of the possible HNBAP
failure paths to find out what is wrong.
Related: SYS#6810
Change-Id: I17d2809f59087d32e7c11a3ada1d3fadf6f0b660
---
M src/osmo-hnbgw/hnbgw.c
M src/osmo-hnbgw/hnbgw_hnbap.c
2 files changed, 32 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/41/36141/1
diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index 086582e..7d09d57 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -188,8 +188,10 @@
struct ue_context *ue;
ue = talloc_zero(g_hnbgw, struct ue_context);
- if (!ue)
+ if (!ue) {
+ LOGHNB(hnb, DHNBAP, LOGL_ERROR, "Failed to allocate new ue_context\n");
return NULL;
+ }
ue->hnb = hnb;
if (imsi)
diff --git a/src/osmo-hnbgw/hnbgw_hnbap.c b/src/osmo-hnbgw/hnbgw_hnbap.c
index 06d1a9d..b5f39af 100644
--- a/src/osmo-hnbgw/hnbgw_hnbap.c
+++ b/src/osmo-hnbgw/hnbgw_hnbap.c
@@ -148,6 +148,9 @@
rc = hnbap_encode_ueregisteraccepties(&accept_out, &accept);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_OCTET_STRING,
&accept.uE_Identity.choice.iMSI);
if (rc < 0) {
+ LOGHNB(ue->hnb, DHNBAP, LOGL_ERROR,
+ "Failed to encode HNBAP UE Register Accept message for UE IMSI-%s
TMSI-0x%x\n",
+ ue->imsi, ue->tmsi);
return rc;
}
@@ -158,7 +161,12 @@
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_HNBAP_UERegisterAccept, &accept_out);
- return hnbgw_hnbap_tx(ue->hnb, msg);
+ rc = hnbgw_hnbap_tx(ue->hnb, msg);
+ if (rc)
+ LOGHNB(ue->hnb, DHNBAP, LOGL_ERROR,
+ "Failed to enqueue HNBAP UE Register Accept message for UE IMSI-%s
TMSI-0x%x\n",
+ ue->imsi, ue->tmsi);
+ return rc;
}
static int hnbgw_tx_ue_register_rej_tmsi(struct hnb_context *hnb, HNBAP_UE_Identity_t
*ue_id)
@@ -526,14 +534,19 @@
ue = ue_context_by_imsi(imsi);
if (!ue)
ue = ue_allocated = ue_context_alloc(ctx, imsi, 0);
+ else
+ LOGHNB(ctx, DHNBAP, LOGL_DEBUG, "UE context for IMSI %s already exists\n",
imsi);
/* Send UERegisterAccept */
rc = hnbgw_tx_ue_register_acc(ue);
if (rc < 0) {
+ LOGHNB(ctx, DHNBAP, LOGL_ERROR, "Failed to transmit HNBAP UE Register Accept for
IMSI %s\n", imsi);
/* If we allocated the UE context but the UE REGISTER fails, get rid of it again: there
will likely
* never be a UE DE-REGISTER for this UE from the HNB, and the ue_context would linger
forever. */
- if (ue_allocated)
+ if (ue_allocated) {
ue_context_free(ue_allocated);
+ LOGHNB(ctx, DHNBAP, LOGL_INFO, "Freed UE context for IMSI %s\n", imsi);
+ }
}
free_and_return_rc:
hnbap_free_ueregisterrequesties(&ies);
--
To view, visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36141?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I17d2809f59087d32e7c11a3ada1d3fadf6f0b660
Gerrit-Change-Number: 36141
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange