From 59c1b645e2d86457ee1c9df56860aec8ee5a606f Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 3 Dec 2015 11:30:43 +0100 Subject: gtphub: check TEI presence in Create PDP Ctx Response Sponsored-by: On-Waves ehi --- openbsc/src/gprs/gtphub.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'openbsc') diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c index 96068bf5a..cb42a12cb 100644 --- a/openbsc/src/gprs/gtphub.c +++ b/openbsc/src/gprs/gtphub.c @@ -1524,6 +1524,16 @@ static int gtphub_handle_create_pdp_ctx(struct gtphub *hub, gtphub_tunnel_endpoint_set_peer(&tun->endpoint[side_idx][plane_idx], peer_from_ie); + if (!tei_from_ie && + !tun->endpoint[side_idx][plane_idx].tei_orig) { + LOG(LOGL_ERROR, + "Create PDP Context message omits %s TEI, but the" + " no TEI has been announced for this tunnel: %s", + gtphub_plane_idx_names[plane_idx], + gtphub_tunnel_str(tun)); + return -1; + } + if (tei_from_ie) { /* Create TEI mapping and replace in GTP packet IE */ uint32_t mapped_tei = nr_pool_next(&hub->tei_pool); -- cgit v1.2.3