From 4d0066ceb6d3b0a8caab3bc81d18b27aa0784041 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sat, 15 Jun 2019 01:08:16 +0700 Subject: [PATCH] gsup_client_mux_tx_error_reply(): fix: do not override IMSI I am not a big fan of using such syntax sugar for initializing structures, and this is one of the reasons: it's much easier to shoot yourself in the foot. IMSI was copied to the new GSUP message, but then overridden. Found using the new TC_mt_ussd_for_unknown_subscr test case. Change-Id: If81c3fa56951185339f33a523ab6364594101be1 Related: (TTCN-3) Id35cd3ec15d1bab15260312d7bbb41e2d10349fe Related: OS#2931 --- src/libmsc/gsup_client_mux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libmsc/gsup_client_mux.c b/src/libmsc/gsup_client_mux.c index 7ec1712e7..292c2a91d 100644 --- a/src/libmsc/gsup_client_mux.c +++ b/src/libmsc/gsup_client_mux.c @@ -150,13 +150,13 @@ void gsup_client_mux_tx_error_reply(struct gsup_client_mux *gcm, const struct os if (!OSMO_GSUP_IS_MSGT_REQUEST(gsup_orig->message_type)) return; - OSMO_STRLCPY_ARRAY(gsup_reply.imsi, gsup_orig->imsi); - gsup_reply = (struct osmo_gsup_message){ .cause = cause, .message_type = OSMO_GSUP_TO_MSGT_ERROR(gsup_orig->message_type), }; + OSMO_STRLCPY_ARRAY(gsup_reply.imsi, gsup_orig->imsi); + if (osmo_gsup_client_enc_send(gcm->gsup_client, &gsup_reply)) LOGP(DLGSUP, LOGL_ERROR, "Failed to send Error reply (imsi=%s)\n", osmo_quote_str(gsup_orig->imsi, -1));