X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fcommon%2Fsrc%2Fwormholes.c;h=a177944682f1763aba867d0a37ff0b5ab3312083;hb=a68562a02028434a87149d5996b291e83d33be51;hp=248748f85b14e3e52b9df38f4bef89ca7ff99702;hpb=8633a0b93e26b619a367de0614437ef2eb4a0b37;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/common/src/wormholes.c b/src/rmr/common/src/wormholes.c index 248748f..a177944 100644 --- a/src/rmr/common/src/wormholes.c +++ b/src/rmr/common/src/wormholes.c @@ -187,6 +187,7 @@ extern rmr_whid_t rmr_wh_open( void* vctx, char const* target ) { rmr_whid_t whid = -1; // wormhole id is the index into the list wh_mgt_t* whm; // easy reference to wh mgt stuff int i; + route_table_t* rt; // the currently active route table if( (ctx = (uta_ctx_t *) vctx) == NULL || target == NULL || *target == 0 ) { @@ -207,8 +208,10 @@ extern rmr_whid_t rmr_wh_open( void* vctx, char const* target ) { whm = ctx->wormholes; - - if( (ep = rt_ensure_ep( ctx->rtable, target )) == NULL ) { // get pointer to ep if there, create new if not + rt = get_rt( ctx ); // get and raise ref counter + ep = rt_ensure_ep( rt, target ); // get pointer to ep if there, create new if not + release_rt( ctx, rt ); // release use counter + if( ep == NULL ) { rmr_vlog( RMR_VL_ERR, "wormhole_open: ensure ep returned bad: target=(%s)\n", target ); return -1; // ensure sets errno }