diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2019-05-07 21:09:01 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2019-05-07 21:12:04 +0700 |
commit | 8625cdaf2aaf95057e21cb754929d9fe21f2e424 (patch) | |
tree | 89e1e913c6b451711d6478f586e6f0c90b3c85b4 | |
parent | 609978d0abf33a06af275328b45a610a06b10052 (diff) |
hlr.c: fix: properly print the original message type in read_cb_forward()
Printing 'OSMO_GSUP_MSGT_E_ROUTING_ERROR' in routing error messages
instead of the original message type may be confusing. Let's store
the original message type, and change just before sending.
Fix for Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5
Change-Id: Ic1db1e089fc0f8e03653a9f05058e95d2adaee39
-rw-r--r-- | src/hlr.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -465,7 +465,7 @@ static int read_cb_forward(struct osmo_gsup_conn *conn, struct msgb *msg, const gsup_err->message_class = gsup->message_class; gsup_err->destination_name = talloc_memdup(gsup_err, gsup->destination_name, gsup->destination_name_len); gsup_err->destination_name_len = gsup->destination_name_len; - gsup_err->message_type = OSMO_GSUP_MSGT_E_ROUTING_ERROR; + gsup_err->message_type = gsup->message_type; gsup_err->session_state = gsup->session_state; gsup_err->session_id = gsup->session_id; gsup_err->source_name = talloc_memdup(gsup_err, gsup->source_name, gsup->source_name_len); @@ -508,6 +508,7 @@ end: if (ret) { struct msgb *msg_err = msgb_alloc_headroom(1024+16, 16, "GSUP forward ERR response"); OSMO_ASSERT(msg_err); + gsup_err->message_type = OSMO_GSUP_MSGT_E_ROUTING_ERROR; osmo_gsup_encode(msg_err, gsup_err); LOGP_GSUP_FWD(gsup_err, LOGL_NOTICE, "Tx %s\n", osmo_gsup_message_type_name(gsup_err->message_type)); osmo_gsup_conn_send(conn, msg_err); |