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/.
lynxis lazus gerrit-no-reply at lists.osmocom.orglynxis lazus has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/15480 )
Change subject: gprs_ranap: refactor REQUIRE_MM define
......................................................................
gprs_ranap: refactor REQUIRE_MM define
All branches need a MM context. Exit early if no MM context
present.
Change-Id: Ifa4c55f1f2c199fa63bd755311026b8586a65f3f
---
M src/sgsn/gprs_ranap.c
1 file changed, 6 insertions(+), 16 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c
index cad8487..b0d0f8d 100644
--- a/src/sgsn/gprs_ranap.c
+++ b/src/sgsn/gprs_ranap.c
@@ -120,31 +120,24 @@
int rc = -1;
mm = sgsn_mm_ctx_by_ue_ctx(ctx);
-
-#define REQUIRE_MM \
- if (!mm) { \
- LOGIUP(ctx, LOGL_NOTICE, "Cannot find mm ctx for IU event %d\n", type); \
- return rc; \
+ if (!mm) {
+ LOGIUP(ctx, LOGL_NOTICE, "Cannot find mm ctx for IU event %d\n", type);
+ return rc;
}
switch (type) {
case RANAP_IU_EVENT_RAB_ASSIGN:
- REQUIRE_MM
rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data);
break;
case RANAP_IU_EVENT_IU_RELEASE:
/* fall thru */
case RANAP_IU_EVENT_LINK_INVALIDATED:
/* Clean up ranap_ue_conn_ctx here */
- if (mm) {
- LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi);
- osmo_fsm_inst_dispatch(mm->iu.mm_state_fsm, E_PMM_PS_CONN_RELEASE, NULL);
- } else
- LOGIUP(ctx, LOGL_INFO, "IU release\n");
+ LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi);
+ osmo_fsm_inst_dispatch(mm->iu.mm_state_fsm, E_PMM_PS_CONN_RELEASE, NULL);
rc = 0;
break;
case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE:
- REQUIRE_MM
/* Continue authentication here */
mm->iu.ue_ctx->integrity_active = 1;
ranap_iu_tx_common_id(mm->iu.ue_ctx, mm->imsi);
@@ -156,10 +149,7 @@
osmo_fsm_inst_dispatch(mm->gmm_att_req.fsm, E_IU_SECURITY_CMD_COMPLETE, NULL);
break;
default:
- if (mm)
- LOGMMCTXP(LOGL_NOTICE, mm, "Unknown event received: %i\n", type);
- else
- LOGIUP(ctx, LOGL_NOTICE, "Unknown event received: %i\n", type);
+ LOGMMCTXP(LOGL_NOTICE, mm, "Unknown event received: %i\n", type);
rc = -1;
break;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/15480
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ifa4c55f1f2c199fa63bd755311026b8586a65f3f
Gerrit-Change-Number: 15480
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190912/3d100042/attachment.htm>