summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-08-18 12:26:23 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-08-18 12:48:51 +0200
commit0ff59c1e1ba7b8f13c519f87b82e5dd144e219cd (patch)
tree2d1a24011893608602172c05751d863c8c92e6af /openbsc/src/libmsc
parentb13196dea30aa8bd4c530373632285716375e32d (diff)
libmsc: Fix wrong handling of user_message_reference parameter
libsmpp34 already converts received TLV integer values to native endianess in libsmpp34_(un)pack. Converting them again at receive time swaps the 2 bytes of user_message_reference, then using a wrong value. As GSM03.40 spec uses only 1 byte for the id, then only the high byte of the initial value is used and eventually sent back to the ESME. Again, at that time, htons() is not needed because libsmpp34 already handles that part. See OS-#2429 for more details. Change-Id: If748548a4a223e529a1110c89e483b599b406e8b
Diffstat (limited to 'openbsc/src/libmsc')
-rw-r--r--openbsc/src/libmsc/smpp_openbsc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c
index e656376b2..af2d1be62 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -120,7 +120,7 @@ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net,
}
break;
case TLVID_user_message_reference:
- msg_ref = ntohs(t->value.val16);
+ msg_ref = t->value.val16;
break;
default:
break;
@@ -436,7 +436,7 @@ void append_tlv_u16(tlv_t **req_tlv, uint16_t tag, uint16_t val)
memset(&tlv, 0, sizeof(tlv));
tlv.tag = tag;
tlv.length = 2;
- tlv.value.val16 = htons(val);
+ tlv.value.val16 = val;
build_tlv(req_tlv, &tlv);
}