From 082b618ea472b31c3aa5b7c823db7f539bb88145 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 8 Oct 2020 02:08:58 +0700 Subject: trxcon/l1ctl_link: use osmo_store16be() in l1ctl_link_send() Change-Id: I96ca1c581d028a1f3c89c83a575fd8dbc9751962 --- src/host/trxcon/l1ctl_link.c | 6 +++--- 1 file 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"); -- cgit v1.2.3