This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
pespin gerrit-no-reply at lists.osmocom.orgpespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/22490 ) Change subject: NACC: delay CTRL conn socket init until it's needed ...................................................................... NACC: delay CTRL conn socket init until it's needed This way, we don't open a socket and do the IPA handshake in the event the request is already cached. Related: SYS#4909 Change-Id: Ib1ea85e1196c8b9dc40c8837ab5d4a54f2a1f2d4 --- M src/nacc_fsm.c 1 file changed, 11 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/90/22490/1 diff --git a/src/nacc_fsm.c b/src/nacc_fsm.c index b8350a6..5e8d51b 100644 --- a/src/nacc_fsm.c +++ b/src/nacc_fsm.c @@ -279,7 +279,7 @@ struct gprs_rlcmac_bts *bts = ctx->ms->bts; struct gprs_pcu *pcu = bts->pcu; const struct osmo_cell_global_id_ps *cgi_ps; - struct ctrl_cmd *cmd; + struct ctrl_cmd *cmd = NULL; int rc; /* First try to find the value in the cache */ @@ -295,6 +295,16 @@ LOGPFSML(fi, LOGL_DEBUG, "No CGI-PS found in cache, resolving " NEIGH_CACHE_ENTRY_KEY_FMT "...\n", NEIGH_CACHE_ENTRY_KEY_ARGS(&ctx->neigh_key)); + rc = osmo_sock_init2_ofd(&ctx->neigh_ctrl_conn->write_queue.bfd, + AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, + NULL, 0, pcu->vty.neigh_ctrl_addr, pcu->vty.neigh_ctrl_port, + OSMO_SOCK_F_CONNECT); + if (rc < 0) { + LOGPFSML(fi, LOGL_ERROR, "Can't connect to CTRL @ %s:%u\n", + pcu->vty.neigh_ctrl_addr, pcu->vty.neigh_ctrl_port); + goto err_term; + } + cmd = ctrl_cmd_create(ctx, CTRL_TYPE_GET); if (!cmd) { LOGPFSML(fi, LOGL_ERROR, "CTRL msg creation failed\n"); @@ -603,11 +613,8 @@ struct nacc_fsm_ctx *nacc_fsm_alloc(struct GprsMs* ms) { - struct gprs_rlcmac_bts *bts = ms->bts; - struct gprs_pcu *pcu = bts->pcu; struct nacc_fsm_ctx *ctx = talloc_zero(ms, struct nacc_fsm_ctx); char buf[64]; - int rc; talloc_set_destructor(ctx, nacc_fsm_ctx_talloc_destructor); @@ -628,16 +635,6 @@ ctx->neigh_ctrl_conn->write_queue.bfd.fd = -1; llist_add(&ctx->neigh_ctrl_conn->list_entry, &ctx->neigh_ctrl->ccon_list); - rc = osmo_sock_init2_ofd(&ctx->neigh_ctrl_conn->write_queue.bfd, - AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, - NULL, 0, pcu->vty.neigh_ctrl_addr, pcu->vty.neigh_ctrl_port, - OSMO_SOCK_F_CONNECT); - if (rc < 0) { - LOGP(DNACC, LOGL_ERROR, "Can't connect to CTRL @ %s:%u\n", - pcu->vty.neigh_ctrl_addr, pcu->vty.neigh_ctrl_port); - goto free_ret; - } - return ctx; free_ret: talloc_free(ctx); -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/22490 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: Ib1ea85e1196c8b9dc40c8837ab5d4a54f2a1f2d4 Gerrit-Change-Number: 22490 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin at sysmocom.de> Gerrit-MessageType: newchange -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210127/a1a8c260/attachment.htm>