summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-10-08 02:08:58 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-11-05 13:36:43 +0700
commit082b618ea472b31c3aa5b7c823db7f539bb88145 (patch)
tree2e61382ba7c52aa7af3302d27d85b80a890ea397
parent7c348548801dd538f0b4be7ea4159efa2e4eaa85 (diff)
trxcon/l1ctl_link: use osmo_store16be() in l1ctl_link_send()
-rw-r--r--src/host/trxcon/l1ctl_link.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c
index 2e2963a8..4c406d6c 100644
--- a/src/host/trxcon/l1ctl_link.c
+++ b/src/host/trxcon/l1ctl_link.c
@@ -184,7 +184,7 @@ static int l1ctl_link_accept(struct osmo_fd *bfd, unsigned int flags)
int l1ctl_link_send(struct l1ctl_link *l1l, struct msgb *msg)
{
- uint16_t *len;
+ uint8_t *len;
/* Debug print */
LOGP(DL1D, LOGL_DEBUG, "TX: '%s'\n",
@@ -194,8 +194,8 @@ int l1ctl_link_send(struct l1ctl_link *l1l, struct msgb *msg)
LOGP(DL1D, LOGL_INFO, "Message L1 header != Message Data\n");
/* Prepend 16-bit length before sending */
- len = (uint16_t *) msgb_push(msg, L1CTL_MSG_LEN_FIELD);
- *len = htons(msg->len - L1CTL_MSG_LEN_FIELD);
+ len = msgb_push(msg, L1CTL_MSG_LEN_FIELD);
+ osmo_store16be(msg->len - L1CTL_MSG_LEN_FIELD, len);
if (osmo_wqueue_enqueue(&l1l->wq, msg) != 0) {
LOGP(DL1D, LOGL_ERROR, "Failed to enqueue msg!\n");