aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-11-30 12:58:48 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-12-03 11:44:03 +0100
commitcd865d62f0446135258189184664a146b28db975 (patch)
treeb92784405b7bec42e2b2c3b01cf6bdf318bbac4c /openbsc/src
parent085500807c3a66e4d6e0a6a2d6516b2a4a13e69c (diff)
gtphub: be more fatal about not finding an unused TEI.
Sponsored-by: On-Waves ehi
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/gprs/gtphub.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c
index 190db2233..d7422de0f 100644
--- a/openbsc/src/gprs/gtphub.c
+++ b/openbsc/src/gprs/gtphub.c
@@ -1506,8 +1506,16 @@ static int gtphub_handle_create_pdp_ctx(struct gtphub *hub,
tun->endpoint[side_idx][plane_idx].tei_repl = mapped_tei;
p->ie[ie_idx]->tv4.v = hton32(mapped_tei);
- if (!gtphub_check_reused_teis(hub, tun))
- return -1;
+ if (!gtphub_check_reused_teis(hub, tun)) {
+ /* It's highly unlikely that all TEIs are
+ * taken. But the code looking for an unused
+ * TEI is, at the time of writing this comment,
+ * not able to find gaps in the TEI space. To
+ * explicitly alert the user of this problem,
+ * rather abort than carry on. */
+ LOG(LOGL_FATAL, "TEI range exhausted. Cannot create TEI mapping, aborting.\n");
+ abort();
+ }
}
/* Replace the GSN address to reflect gtphub. */