diff --git a/lib/gtp/gtp_xact.c b/lib/gtp/gtp_xact.c index f283f70cd..0bc989ef3 100644 --- a/lib/gtp/gtp_xact.c +++ b/lib/gtp/gtp_xact.c @@ -160,6 +160,13 @@ gtp_xact_t *gtp_xact_remote_create(gtp_xact_ctx_t *context, status_t gtp_xact_commit( gtp_xact_t *xact, c_uint8_t type, gtp_message_t *gtp_message) +{ + return gtp_xact_associated_commit(xact, NULL, type, gtp_message); +} + +status_t gtp_xact_associated_commit( + gtp_xact_t *xact, gtp_xact_t *assoc_xact, + c_uint8_t type, gtp_message_t *gtp_message) { status_t rv; pkbuf_t *pkbuf = NULL; @@ -193,6 +200,12 @@ status_t gtp_xact_commit( d_assert(gtp_send(xact->sock, xact->gnode, xact->pkbuf) == CORE_OK, goto out, "gtp_send error"); + if (assoc_xact) + { + xact->assoc_xact = assoc_xact; + assoc_xact->assoc_xact = xact; + } + return CORE_OK; out: diff --git a/lib/gtp/gtp_xact.h b/lib/gtp/gtp_xact.h index ff05e0e6f..b9da91efd 100644 --- a/lib/gtp/gtp_xact.h +++ b/lib/gtp/gtp_xact.h @@ -57,6 +57,9 @@ CORE_DECLARE(gtp_xact_t *) gtp_xact_remote_create(gtp_xact_ctx_t *context, CORE_DECLARE(status_t) gtp_xact_commit( gtp_xact_t *xact, c_uint8_t type, gtp_message_t *gtp_message); +CORE_DECLARE(status_t) gtp_xact_associated_commit( + gtp_xact_t *xact, gtp_xact_t *assoc_xact, + c_uint8_t type, gtp_message_t *gtp_message); CORE_DECLARE(status_t) gtp_xact_timeout(gtp_xact_t *xact); CORE_DECLARE(gtp_xact_t *) gtp_xact_preprocess(gtp_xact_ctx_t *context, diff --git a/src/sgw/sgw_path.c b/src/sgw/sgw_path.c index 22e0bb482..c48e48165 100644 --- a/src/sgw/sgw_path.c +++ b/src/sgw/sgw_path.c @@ -165,8 +165,8 @@ status_t sgw_s5c_send_to_pgw( sgw_self()->s5c_sock, &sgw_self()->s5c_node); d_assert(xact, return CORE_ERROR, "Null param"); - xact->assoc_xact = assoc_xact; - d_assert(gtp_xact_commit(xact, type, gtp_message) == CORE_OK, + d_assert(gtp_xact_associated_commit( + xact, assoc_xact, type, gtp_message) == CORE_OK, return CORE_ERROR, "gtp_send error"); return CORE_OK;