summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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");