aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-10-20 14:28:04 +0200
committerMax <msuraev@sysmocom.de>2017-10-20 14:28:04 +0200
commit6f2440282cd06adc8ddb08b32546ab6f27abe9ce (patch)
tree90df4d93a17615674611fae9c068a8d2cb0fbfa4
parentbaabc681aea5d950d97db59aea96002e08d3b955 (diff)
SGSN: check that GSN is created in proper mode
-rw-r--r--src/gprs/sgsn_libgtp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c
index 9b8fe16c..04735e22 100644
--- a/src/gprs/sgsn_libgtp.c
+++ b/src/gprs/sgsn_libgtp.c
@@ -838,6 +838,9 @@ int sgsn_gtp_init(struct sgsn_instance *sgi)
}
gsn = sgi->gsn;
+ if (gsn->mode != GTP_MODE_SGSN)
+ return -EINVAL;
+
sgi->gtp_fd0.fd = gsn->fd0;
sgi->gtp_fd0.priv_nr = 0;
sgi->gtp_fd0.data = sgi;