From patchwork Tue May 31 11:42:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gerrit-no-reply@lists.osmocom.org X-Patchwork-Id: 628166 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (lists.osmocom.org [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 3rJs741nbnz9t41 for ; Tue, 31 May 2016 21:42:56 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 8A73C2281F; Tue, 31 May 2016 11:42:54 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from 127.0.1.12 (unknown [127.0.1.12]) by lists.osmocom.org (Postfix) with ESMTPA id 2486322785; Tue, 31 May 2016 11:42:47 +0000 (UTC) Date: Tue, 31 May 2016 11:42:47 +0000 From: Neels Hofmeyr Message-ID: X-Gerrit-MessageType: newchange Subject: [PATCH] openbsc[master]: create_pdp_conf(): factor out PDP context accept dispatch as... X-Gerrit-Change-Id: Ie7dff857a76c1464988b2f514643518937b57c5a X-Gerrit-ChangeURL: X-Gerrit-Commit: c63d3b828defbc6bee4873a3fcb91b3fe5731b65 MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/2.12.2-31-gb331dbd-dirty X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: nhofmeyr@sysmocom.de Cc: daniel Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" Review at https://gerrit.osmocom.org/150 create_pdp_conf(): factor out PDP context accept dispatch as send_act_pdp_cont_acc() Change-Id: Ie7dff857a76c1464988b2f514643518937b57c5a --- M openbsc/src/gprs/sgsn_libgtp.c 1 file changed, 14 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/50/150/1 diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index f7a4ca0..504590b 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -304,10 +304,22 @@ { 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 @@ /* 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: /*