diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-11-22 20:38:19 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-11-22 20:42:49 +0100 |
commit | 671db90ac316665edb8894c204d44d26ba97e5c3 (patch) | |
tree | c5b5a71bd664cd61a4bf2b1c8fdc06a3e011ff1d /src | |
parent | d3814b936b2ec9712561262be5a00320711ef249 (diff) |
cosmetic: rx_send_auth_info(): decide error cause with switch()
Prepare for tweaking error handling in a subsequent patch: use switch() instead
of if().
Prepares-for: I90df7b255317df1e5d968e7ce3b9d2c404b98db8
Change-Id: I1f628aa9d62b778951726bebec8cf338444fc897
Diffstat (limited to 'src')
-rw-r--r-- | src/hlr.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -67,12 +67,16 @@ static int rx_send_auth_info(struct osmo_gsup_conn *conn, gsup_out.auth_vectors, ARRAY_SIZE(gsup_out.auth_vectors), gsup->rand, gsup->auts); - if (rc < 0) { - gsup_out.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR; - gsup_out.cause = GMM_CAUSE_NET_FAIL; - } else if (rc == 0) { + if (rc <= 0) { gsup_out.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR; - gsup_out.cause = GMM_CAUSE_IMSI_UNKNOWN; + switch (rc) { + case 0: + gsup_out.cause = GMM_CAUSE_IMSI_UNKNOWN; + break; + default: + gsup_out.cause = GMM_CAUSE_NET_FAIL; + break; + } } else { gsup_out.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT; gsup_out.num_auth_vectors = rc; |