Change in osmo-sgsn[master]: sgsn_ggsn_ctx_drop_pdp: protect against nullpointer when MM is gone

2018-09-19 Thread lynxis lazus
lynxis lazus has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11020 )

Change subject: sgsn_ggsn_ctx_drop_pdp: protect against nullpointer when MM is 
gone
..

sgsn_ggsn_ctx_drop_pdp: protect against nullpointer when MM is gone

When the GGSN crashs, the SGSN will be notified after
it comes back. Because of the async operation,
the mm ctx could be already gone.

Change-Id: I507a8c2193c84f8dff7f5d669adcd3583331f289
---
M src/gprs/gprs_sgsn.c
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved
  Pau Espin Pedrol: Looks good to me, approved



diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index 977ae48..dc0e7c0 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -707,7 +707,9 @@

 void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx)
 {
-   if (pctx->mm->gmm_state == GMM_REGISTERED_NORMAL) {
+   /* the MM context can be deleted while the GGSN is not reachable or
+* if has been crashed. */
+   if (pctx->mm && pctx->mm->gmm_state == GMM_REGISTERED_NORMAL) {
gsm48_tx_gsm_deact_pdp_req(pctx, GSM_CAUSE_NET_FAIL, true);
sgsn_ggsn_ctx_remove_pdp(pctx->ggsn, pctx);
} else  {

--
To view, visit https://gerrit.osmocom.org/11020
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I507a8c2193c84f8dff7f5d669adcd3583331f289
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: lynxis lazus 


Change in osmo-sgsn[master]: sgsn_ggsn_ctx_drop_pdp: protect against nullpointer when MM is gone

2018-09-19 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/11020 )

Change subject: sgsn_ggsn_ctx_drop_pdp: protect against nullpointer when MM is 
gone
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11020
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I507a8c2193c84f8dff7f5d669adcd3583331f289
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Wed, 19 Sep 2018 09:43:28 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-sgsn[master]: sgsn_ggsn_ctx_drop_pdp: protect against nullpointer when MM is gone

2018-09-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11020 )

Change subject: sgsn_ggsn_ctx_drop_pdp: protect against nullpointer when MM is 
gone
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11020
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I507a8c2193c84f8dff7f5d669adcd3583331f289
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Tue, 18 Sep 2018 20:28:12 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-sgsn[master]: sgsn_ggsn_ctx_drop_pdp: protect against nullpointer when MM is gone

2018-09-18 Thread lynxis lazus
lynxis lazus has uploaded this change for review. ( 
https://gerrit.osmocom.org/11020


Change subject: sgsn_ggsn_ctx_drop_pdp: protect against nullpointer when MM is 
gone
..

sgsn_ggsn_ctx_drop_pdp: protect against nullpointer when MM is gone

When the GGSN crashs, the SGSN will be notified after
it comes back. Because of the async operation,
the mm ctx could be already gone.

Change-Id: I507a8c2193c84f8dff7f5d669adcd3583331f289
---
M src/gprs/gprs_sgsn.c
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/20/11020/1

diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index 977ae48..dc0e7c0 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -707,7 +707,9 @@

 void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx)
 {
-   if (pctx->mm->gmm_state == GMM_REGISTERED_NORMAL) {
+   /* the MM context can be deleted while the GGSN is not reachable or
+* if has been crashed. */
+   if (pctx->mm && pctx->mm->gmm_state == GMM_REGISTERED_NORMAL) {
gsm48_tx_gsm_deact_pdp_req(pctx, GSM_CAUSE_NET_FAIL, true);
sgsn_ggsn_ctx_remove_pdp(pctx->ggsn, pctx);
} else  {

--
To view, visit https://gerrit.osmocom.org/11020
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I507a8c2193c84f8dff7f5d669adcd3583331f289
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus