aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2016-05-21 01:40:19 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-06-01 12:09:51 +0000
commit62ff38447ce8d24aa1e8b5094153df9e89c986d0 (patch)
tree1f15c0c14ff680e3d1061866a3fb8ea975450924
parentf97ee04563cc36af6ffa7506d543ba0bd230430d (diff)
create_pdp_conf(): factor out PDP context accept dispatch as send_act_pdp_cont_acc()
-rw-r--r--openbsc/src/gprs/sgsn_libgtp.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c
index f7a4ca0a7..504590bbe 100644
--- a/openbsc/src/gprs/sgsn_libgtp.c
+++ b/openbsc/src/gprs/sgsn_libgtp.c
@@ -304,10 +304,22 @@ static const struct cause_map gtp2sm_cause_map[] = {
{ 0, 0 }
};
+static int send_act_pdp_cont_acc(struct sgsn_pdp_ctx *pctx)
+{
+ struct sgsn_signal_data sig_data;
+
+ /* Inform others about it */
+ memset(&sig_data, 0, sizeof(sig_data));
+ sig_data.pdp = pctx;
+ osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_ACT, &sig_data);
+
+ /* Send PDP CTX ACT to MS */
+ return gsm48_tx_gsm_act_pdp_acc(pctx);
+}
+
/* The GGSN has confirmed the creation of a PDP Context */
static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
{
- struct sgsn_signal_data sig_data;
struct sgsn_pdp_ctx *pctx = cbp;
uint8_t reject_cause;
@@ -342,14 +354,7 @@ static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
/* Activate the SNDCP layer */
sndcp_sm_activate_ind(&pctx->mm->gb.llme->lle[pctx->sapi], pctx->nsapi);
-
- /* Inform others about it */
- memset(&sig_data, 0, sizeof(sig_data));
- sig_data.pdp = pctx;
- osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_ACT, &sig_data);
-
- /* Send PDP CTX ACT to MS */
- return gsm48_tx_gsm_act_pdp_acc(pctx);
+ return send_act_pdp_cont_acc(pctx);
reject:
/*