directly discard hnb that failed to register upon connect
Change-Id: Ib6883294a4ad990a888db5abb0555b08af49f085
This commit is contained in:
parent
a3cccdc51c
commit
4d158e6f0d
|
@ -99,6 +99,7 @@ struct hnb_context {
|
||||||
|
|
||||||
/*! True if a HNB-REGISTER-REQ from this HNB has been accepted. Note that
|
/*! True if a HNB-REGISTER-REQ from this HNB has been accepted. Note that
|
||||||
* this entire data structure is freed if the HNB sends HNB-DE-REGISTER-REQ. */
|
* this entire data structure is freed if the HNB sends HNB-DE-REGISTER-REQ. */
|
||||||
|
bool hnb_register_attempted;
|
||||||
bool hnb_registered;
|
bool hnb_registered;
|
||||||
|
|
||||||
/* linked list of hnbgw_context_map */
|
/* linked list of hnbgw_context_map */
|
||||||
|
|
|
@ -287,7 +287,7 @@ struct hnb_context *hnb_context_alloc(struct hnb_gw *gw, struct osmo_stream_srv_
|
||||||
|
|
||||||
ctx->gw = gw;
|
ctx->gw = gw;
|
||||||
ctx->conn = osmo_stream_srv_create(tall_hnb_ctx, link, new_fd, hnb_read_cb, NULL, ctx);
|
ctx->conn = osmo_stream_srv_create(tall_hnb_ctx, link, new_fd, hnb_read_cb, NULL, ctx);
|
||||||
if (!ctx->conn) {
|
if (!ctx->conn || (ctx->hnb_register_attempted && !ctx->hnb_registered)) {
|
||||||
LOGP(DMAIN, LOGL_INFO, "error while creating connection\n");
|
LOGP(DMAIN, LOGL_INFO, "error while creating connection\n");
|
||||||
talloc_free(ctx);
|
talloc_free(ctx);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -417,6 +417,8 @@ static int hnbgw_rx_hnb_register_req(struct hnb_context *ctx, ANY_t *in)
|
||||||
HNBRegisterRequestIEs_t ies;
|
HNBRegisterRequestIEs_t ies;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
ctx->hnb_register_attempted = true;
|
||||||
|
|
||||||
rc = hnbap_decode_hnbregisterrequesties(&ies, in);
|
rc = hnbap_decode_hnbregisterrequesties(&ies, in);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
LOGP(DHNBAP, LOGL_ERROR, "Failure to decode HNB-REGISTER-REQ from %s: rc=%d\n",
|
LOGP(DHNBAP, LOGL_ERROR, "Failure to decode HNB-REGISTER-REQ from %s: rc=%d\n",
|
||||||
|
|
Loading…
Reference in New Issue