lynxis lazus has uploaded this change for review.

View Change

mmctx: LOGIUP: allow ue to be NULL

In certain cases, the ue can be NULL.
E.g. when receiving a new Iu event without a context.

Change-Id: Ie569fa100abe518cb63c1b918ad7748a7ea3bb99
---
M include/osmocom/sgsn/mmctx.h
1 file changed, 6 insertions(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/98/40698/1
diff --git a/include/osmocom/sgsn/mmctx.h b/include/osmocom/sgsn/mmctx.h
index 9fa06dc..7c4764e 100644
--- a/include/osmocom/sgsn/mmctx.h
+++ b/include/osmocom/sgsn/mmctx.h
@@ -231,7 +231,12 @@

#ifdef BUILD_IU
#define LOGIUP(ue, level, fmt, args...) \
- LOGP(DMM, level, "UE(0x%x){%s} " fmt, ue->conn_id, osmo_rai_name(&(ue)->ra_id), ## args)
+ do { \
+ if (ue) \
+ LOGP(DMM, level, "UE(0x%x){%s} " fmt, ue->conn_id, osmo_rai_name(&(ue)->ra_id), ## args); \
+ else \
+ LOGP(DMM, level, "UE(NULL){} " fmt, ## args); \
+ } while (0)
#else
#define LOGIUP(ue, level, fmt, args...) \
LOGP(DMM, level, "UE(%p){NOTSUPPORTED} " fmt, ue, ## args)

To view, visit change 40698. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ie569fa100abe518cb63c1b918ad7748a7ea3bb99
Gerrit-Change-Number: 40698
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis@fe80.eu>