summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2016-02-03 15:17:42 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2016-02-04 15:52:19 +0100
commitfdf2d9183e42f0fa1881218586d75ad9ef9d86d5 (patch)
treea7290fc22d41c6b01f78c4d1c9ec9b0b384c0d0a
parente5d68352ad6f881d116cda79bd5ac3a478fc2010 (diff)
sgsn: Get gtp ip and teid from pdp context in gprs_iu_rab_act()
-rw-r--r--openbsc/src/gprs/sgsn_iu.c12
-rw-r--r--openbsc/src/gprs/sgsn_libgtp.c7
2 files changed, 12 insertions, 7 deletions
diff --git a/openbsc/src/gprs/sgsn_iu.c b/openbsc/src/gprs/sgsn_iu.c
index 7bcb9dbe2..d43111a8b 100644
--- a/openbsc/src/gprs/sgsn_iu.c
+++ b/openbsc/src/gprs/sgsn_iu.c
@@ -20,6 +20,8 @@
#include <openbsc/gprs_sgsn.h>
#include <openbsc/debug.h>
+#include <pdp.h>
+
#include <osmocom/ranap/ranap_ies_defs.h>
#include <osmocom/ranap/ranap_common_cn.h>
@@ -61,17 +63,23 @@ struct ue_conn_ctx *ue_conn_ctx_find(struct osmo_sua_link *link, uint32_t conn_i
* RANAP handling
***********************************************************************/
-int gprs_iu_rab_act(struct sgsn_pdp_ctx *pdp, uint32_t gtp_ip, uint32_t gtp_tei)
+int gprs_iu_rab_act(struct sgsn_pdp_ctx *pdp)
{
struct sgsn_mm_ctx *mm = pdp->mm;
struct ue_conn_ctx *uectx;
struct osmo_scu_prim *prim;
struct msgb *msg;
+ uint32_t ggsn_ip;
uectx = mm->iu.ue_ctx;
uectx->pdp = pdp;
- msg = ranap_new_msg_rab_assign_data(1, gtp_ip, gtp_tei);
+
+ /* Get the IP address for ggsn user plane */
+ memcpy(&ggsn_ip, pdp->lib->gsnru.v, pdp->lib->gsnru.l);
+ ggsn_ip = htonl(ggsn_ip);
+
+ msg = ranap_new_msg_rab_assign_data(1, ggsn_ip, pdp->lib->teid_own);
msg->l2h = msg->data;
/* wrap RANAP message in SCCP N-DATA.req */
diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c
index c15c499b2..66efc1dad 100644
--- a/openbsc/src/gprs/sgsn_libgtp.c
+++ b/openbsc/src/gprs/sgsn_libgtp.c
@@ -90,7 +90,7 @@ const struct value_string gtp_cause_strs[] = {
{ 0, NULL }
};
-int gprs_iu_rab_act(struct sgsn_pdp_ctx *mm, uint32_t gtp_ip, uint32_t gtp_tei);
+int gprs_iu_rab_act(struct sgsn_pdp_ctx *pdp);
/* Generate the GTP IMSI IE according to 09.60 Section 7.9.2 */
static uint64_t imsi_str2gtp(char *str)
@@ -356,10 +356,7 @@ static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
return send_act_pdp_cont_acc(pctx);
} else {
/* Activate a radio bearer */
- uint32_t ggsn_ip;
- memcpy(&ggsn_ip, pdp->gsnru.v, pdp->gsnru.l);
- ggsn_ip = htonl(ggsn_ip);
- gprs_iu_rab_act(pctx, ggsn_ip, pdp->teid_own);
+ gprs_iu_rab_act(pctx);
return 0;
}