Project

General

Profile

Actions

Bug #4303

open

various minor issues about evaluation of rc = db_subscr_get_by_*()

Added by neels over 4 years ago. Updated over 4 years ago.

Status:
New
Priority:
Low
Assignee:
-
Target version:
-
Start date:
12/03/2019
Due date:
% Done:

0%

Spec Reference:

Description

vty function 'subscriber imsi IDENT create':

We create the subscriber, and then db_subscr_get_by_imsi(), which might produce an error.
It's unlikely since creationg rc is evaluated just before that, but still.
If the rc returns an error, we should echo that to the VTY user.

        rc = db_subscr_get_by_imsi(g_hlr->dbc, imsi, &subscr);
        vty_out(vty, "%% Created subscriber %s%s", imsi, VTY_NEWLINE);

        subscr_dump_full_vty(vty, &subscr);

        return CMD_SUCCESS;
}
Actions #1

Updated by neels over 4 years ago

  • Subject changed from hlr_vty_subscr.c: subscriber_create_cmd: evaluate rc of rc = db_subscr_get_by_imsi(g_hlr->dbc, imsi, &subscr); to various minor issues about evaluation of rc = db_subscr_get_by_*()

also show error in subscriber_msisdn_cmd

                if (db_subscr_get_by_msisdn(g_hlr->dbc, msisdn, &subscr) == 0)
                        osmo_hlr_subscriber_update_notify(&subscr);

and these should probably just do 'if (rc)' not '< 0':

hlr_db_tool.c-325-      if (rc < 0) {
hlr.c:412:              if (db_subscr_get_by_imsi(g_hlr->dbc, gsup->imsi, &subscr) < 0) {
lu_fsm.c:138:   if (db_subscr_get_by_imsi(g_hlr->dbc, update_location_req->gsup.imsi, &lu->subscr) < 0) {

maybe this could differentiate between -ENOENT and actual database errors:

mslookup_server.c-252-  if (rc) {
mslookup_server.c-253- LOGP(DMSLOOKUP, LOGL_DEBUG, "%s: does not exist in local HLR\n",
mslookup_server.c-254- osmo_mslookup_result_name_c(OTC_SELECT, query, NULL));
mslookup_server.c-255- return false;
mslookup_server.c-256- }
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)