Review at https://gerrit.osmocom.org/6198
Use helper for adding IMSI to GSUP message N. B: requires I03d0d3d32a8d572ad573d03c603e14cdc27a3f7b in libosmocore. Change-Id: I67b482dedfa11237ac21894fc5930039e12434ab Related: OS#2864 --- M src/libcommon/gsup_test_client.c M src/libvlr/vlr.c 2 files changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/98/6198/1 diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c index ceac414..2f495c7 100644 --- a/src/libcommon/gsup_test_client.c +++ b/src/libcommon/gsup_test_client.c @@ -108,7 +108,7 @@ struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); int rc; - osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); + OSMO_GSUP_COPY_IMSI(&gsup, io->imsi); gsup.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; rc = osmo_gsup_encode(msg, &gsup); @@ -128,7 +128,7 @@ struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); int rc; - osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); + OSMO_GSUP_COPY_IMSI(&gsup, io->imsi); gsup.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; rc = osmo_gsup_encode(msg, &gsup); @@ -146,7 +146,7 @@ struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); int rc; - osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); + OSMO_GSUP_COPY_IMSI(&gsup, io->imsi); gsup.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; rc = osmo_gsup_encode(msg, &gsup); diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index a87c4b2..292edb0 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -156,7 +156,7 @@ struct vlr_instance *vlr = vsub->vlr; if (strlen(gsup_msg->imsi) == 0) - osmo_strlcpy(gsup_msg->imsi, vsub->imsi, sizeof(gsup_msg->imsi)); + OSMO_GSUP_COPY_IMSI(gsup_msg, vsub->imsi); return vlr_tx_gsup_message(vlr, gsup_msg); } @@ -168,7 +168,7 @@ { struct osmo_gsup_message gsup_reply = {0}; - osmo_strlcpy(gsup_reply.imsi, gsup_orig->imsi, sizeof(gsup_reply.imsi)); + OSMO_GSUP_COPY_IMSI(&gsup_reply, gsup_orig->imsi); gsup_reply.cause = cause; gsup_reply.message_type = OSMO_GSUP_TO_MSGT_ERROR(gsup_orig->message_type); @@ -570,7 +570,8 @@ struct osmo_gsup_message gsup_msg = {0}; gsup_msg.message_type = OSMO_GSUP_MSGT_AUTH_FAIL_REPORT; - osmo_strlcpy(gsup_msg.imsi, vsub->imsi, sizeof(gsup_msg.imsi)); + OSMO_GSUP_COPY_IMSI(&gsup_msg, vsub->imsi); + return vlr_tx_gsup_message(vsub->vlr, &gsup_msg); } -- To view, visit https://gerrit.osmocom.org/6198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I67b482dedfa11237ac21894fc5930039e12434ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max <msur...@sysmocom.de>