gtphub: avoid segfault for incomplete tunnels.
Sponsored-by: On-Waves ehi
diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c
index 60c3cc1..8a28156 100644
--- a/openbsc/src/gprs/gtphub.c
+++ b/openbsc/src/gprs/gtphub.c
@@ -1276,6 +1276,7 @@
struct gtphub_tunnel_endpoint *te_to =
&tun->endpoint[other_side][p->plane_idx];
if ((te_to->tei_repl == p->header_tei_rx)
+ && te_from->peer
&& gsn_addr_same(&te_from->peer->peer_addr->addr,
&from->peer_addr->addr)) {
gtphub_tunnel_refresh(hub, tun, p->timestamp);