diff options
Diffstat (limited to 'src/host/layer23')
-rw-r--r-- | src/host/layer23/src/common/l1l2_interface.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/host/layer23/src/common/l1l2_interface.c b/src/host/layer23/src/common/l1l2_interface.c index d89995d9..956279d3 100644 --- a/src/host/layer23/src/common/l1l2_interface.c +++ b/src/host/layer23/src/common/l1l2_interface.c @@ -157,16 +157,13 @@ int layer2_close(struct osmocom_ms *ms) int osmo_send_l1(struct osmocom_ms *ms, struct msgb *msg) { - uint16_t *len; - DEBUGP(DL1C, "Sending: '%s'\n", osmo_hexdump(msg->data, msg->len)); if (msg->l1h != msg->data) LOGP(DL1C, LOGL_ERROR, "Message L1 header != Message Data\n"); - + /* prepend 16bit length before sending */ - len = (uint16_t *) msgb_push(msg, sizeof(*len)); - *len = htons(msg->len - sizeof(*len)); + msgb_push_u16(msg, msg->len); if (osmo_wqueue_enqueue(&ms->l2_wq, msg) != 0) { LOGP(DL1C, LOGL_ERROR, "Failed to enqueue msg.\n"); |