From cd865d62f0446135258189184664a146b28db975 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 30 Nov 2015 12:58:48 +0100 Subject: gtphub: be more fatal about not finding an unused TEI. Sponsored-by: On-Waves ehi --- openbsc/src/gprs/gtphub.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'openbsc/src/gprs/gtphub.c') 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. */ -- cgit v1.2.3