Change in osmo-hlr[master]: VTY: integrate IMEI

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Mon Jan 21 15:47:24 UTC 2019


osmith has posted comments on this change. ( https://gerrit.osmocom.org/12527 )

Change subject: VTY: integrate IMEI
......................................................................


Patch Set 8:

(3 comments)

https://gerrit.osmocom.org/#/c/12527/8/src/hlr_vty_subscr.c
File src/hlr_vty_subscr.c:

https://gerrit.osmocom.org/#/c/12527/8/src/hlr_vty_subscr.c@136
PS8, Line 136: 	char imei_buf[15];
> use the constant, what was that, GSM23003_IMEI_MAX_LEN? add + 1 for the '\0'?
There is GSM23003_IMEISV_NUM_DIGITS = 15. What we need is something like GSM23003_IMEI_NUM_NO_CHK_DIGITS = 14, added it here: https://gerrit.osmocom.org/#/c/libosmocore/+/12666/ (please review)

...then I can write imei_buf[GSM23003_IMEI_NUM_NO_CHK_DIGITS + 1] and it is obvious what it means.


https://gerrit.osmocom.org/#/c/12527/8/src/hlr_vty_subscr.c@149
PS8, Line 149: 			osmo_strlcpy(imei_buf, id, 15);
> the 15 refers to the sizeof() the target buffer; IMHO this should either be sizeof() or some OSMO_MI […]
Well, I had used strncpy before:
https://gerrit.osmocom.org/#/c/osmo-hlr/+/12527/6/src/hlr_vty_subscr.c@150

I'll go with osmo_strlcpy and a more explicit comment.


https://gerrit.osmocom.org/#/c/12527/8/src/hlr_vty_subscr.c@151
PS8, Line 151: 		}
> what if the digit is present and invalid?
It tries to query the IMEI with db_subscr_get_by_imei(), which will tell the user that it is invalid:

 OsmoHLR# subscriber imei 35761300444848 show
     ID: 1
     IMSI: 123456789023000
     MSISDN: none
     IMEI: 357613004448485
 OsmoHLR# subscriber imei 357613004448484 show
 % No subscriber for imei = '357613004448484'

I don't think we need to optimize here and make it not query the database, or give out another error message.



-- 
To view, visit https://gerrit.osmocom.org/12527
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1af7b573ca2a1cb22497052665012d9c1acf3b30
Gerrit-Change-Number: 12527
Gerrit-PatchSet: 8
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-CC: Max <msuraev at sysmocom.de>
Gerrit-Comment-Date: Mon, 21 Jan 2019 15:47:24 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190121/b4b5c819/attachment.htm>


More information about the gerrit-log mailing list