Review at https://gerrit.osmocom.org/5424
libmsc: a_iface_bssap.c: Fix compilation warning Fixes following compilation warning: osmo-msc/src/libmsc/a_iface_bssap.c:328:11: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifi ers] msg->l3h = TLVP_VAL(&tp, GSM0808_IE_LAYER_3_INFORMATION); ^ osmo-msc/src/libmsc/a_iface_bssap.c:424:12: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifi ers] msg->l3h = TLVP_VAL(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS); ^ Change-Id: I28073efd5cff58cd212341bceee784caf08d5ad8 --- M src/libmsc/a_iface_bssap.c 1 file changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/24/5424/1 diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 922dca9..15ec26e 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -324,9 +324,9 @@ } /* Parse Layer 3 Information element */ - /* FIXME: This is probably to hackish, compiler also complains "assignment discards ‘const’ qualifier..." */ - msg->l3h = TLVP_VAL(&tp, GSM0808_IE_LAYER_3_INFORMATION); - msg->tail = msg->l3h + TLVP_LEN(&tp, GSM0808_IE_LAYER_3_INFORMATION); + msgb_l3trim(msg, 0); + msg->l3h = msgb_put(msg, TLVP_LEN(&tp, GSM0808_IE_LAYER_3_INFORMATION)); + memcpy(msg->l3h, TLVP_VAL(&tp, GSM0808_IE_LAYER_3_INFORMATION), msgb_l3len(msg)); /* Create new subscriber context */ conn = subscr_conn_allocate_a(a_conn_info, network, lac, scu, a_conn_info->conn_id); @@ -421,8 +421,9 @@ } if (TLVP_PRESENT(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS)) { - msg->l3h = TLVP_VAL(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS); - msg->tail = msg->l3h + TLVP_LEN(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS); + msgb_l3trim(msg, 0); + msg->l3h = msgb_put(msg, TLVP_LEN(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS)); + memcpy(msg->l3h, TLVP_VAL(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS), msgb_l3len(msg)); } else { msgb_free(msg); msg = NULL; -- To view, visit https://gerrit.osmocom.org/5424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I28073efd5cff58cd212341bceee784caf08d5ad8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>