From 7a950888f5cb2e196e035d8983925a61e7a6e415 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 17 Mar 2019 09:35:16 +0100 Subject: [PATCH] client: Don't ntohs() integer values from asn1 decoder The ASN1 decoder takes care of endianness for us. Change-Id: I9c3127b4fb195db5e81702e043e4fe595474b561 --- src/remsim_client.c | 2 +- src/simtrace2-remsim_client.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/remsim_client.c b/src/remsim_client.c index 0fb9f21..ac8b13e 100644 --- a/src/remsim_client.c +++ b/src/remsim_client.c @@ -142,7 +142,7 @@ static int srvc_handle_rx(struct rspro_server_conn *srvc, const RsproPDU_t *pdu) /* store/set the bankd ip/port as instructed by the server */ osmo_talloc_replace_string(g_client, &g_client->bankd_host, rspro_IpAddr2str(&pdu->msg.choice.configClientBankReq.bankd.ip)); - g_client->bankd_port = ntohs(pdu->msg.choice.configClientBankReq.bankd.port); + g_client->bankd_port = pdu->msg.choice.configClientBankReq.bankd.port; rspro2bank_slot(&g_client->bankd_slot, &pdu->msg.choice.configClientBankReq.bankSlot); /* instruct bankd FSM to connect */ osmo_fsm_inst_dispatch(g_client->bankd_fi, BDC_E_ESTABLISH, NULL); diff --git a/src/simtrace2-remsim_client.c b/src/simtrace2-remsim_client.c index 2780682..b2d95a7 100644 --- a/src/simtrace2-remsim_client.c +++ b/src/simtrace2-remsim_client.c @@ -635,7 +635,7 @@ static int srvc_handle_rx(struct rspro_server_conn *srvc, const RsproPDU_t *pdu) osmo_talloc_replace_string(g_client, &g_client->bankd_host, rspro_IpAddr2str(&pdu->msg.choice.configClientBankReq.bankd.ip)); rspro2bank_slot(&g_client->bankd_slot, &pdu->msg.choice.configClientBankReq.bankSlot); - g_client->bankd_port = ntohs(pdu->msg.choice.configClientBankReq.bankd.port); + g_client->bankd_port = pdu->msg.choice.configClientBankReq.bankd.port; /* instruct bankd FSM to connect */ osmo_fsm_inst_dispatch(g_client->bankd_fi, BDC_E_ESTABLISH, NULL); /* send response to server */