pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/38436?usp=email )

Change subject: ranap: Reject ActivatePDPCtx from UE if RABAssResp parsing fails
......................................................................

ranap: Reject ActivatePDPCtx from UE if RABAssResp parsing fails

Before this patch, if Rx path at RAB Ass Req failed, the PDP ctx in the
middle of being activated was left untouched.
Explicitly communicate the failure to both sides (UE and GGSN).

Related: OS#6508
Related: SYS#7119
Change-Id: I111cc4b17100d2e1ef756b654dc9e98415b3a8bb
---
M src/sgsn/gprs_ranap.c
1 file changed, 13 insertions(+), 3 deletions(-)

Approvals:
  lynxis lazus: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c
index 8548d59..2ad663e 100644
--- a/src/sgsn/gprs_ranap.c
+++ b/src/sgsn/gprs_ranap.c
@@ -68,6 +68,7 @@
        pdp = sgsn_pdp_ctx_by_nsapi(ctx, rab_id);
        if (!pdp) {
                LOGP(DRANAP, LOGL_ERROR, "RAB Assignment Response for unknown 
RAB/NSAPI=%u\n", rab_id);
+               sgsn_ranap_iu_release_free(ctx, NULL);
                return -1;
        }

@@ -81,7 +82,7 @@
                             "RAB Assignment Resp: Unknown Transport Layer 
Address (size %u): %s\n",
                             item->transportLayerAddress->size,
                             osmo_hexdump(item->transportLayerAddress->buf, 
item->transportLayerAddress->size));
-                       return -1;
+                       goto ret_error;
                }

                switch (addr.u.sa.sa_family) {
@@ -92,12 +93,12 @@
                        /* TODO: Support IPv6 address */
                        LOGP(DRANAP, LOGL_ERROR,
                             "RAB Assignment Resp: IPv6 transport layer address 
not supported!\n");
-                       return -1;
+                       goto ret_error;
                default:
                        LOGP(DRANAP, LOGL_ERROR,
                             "RAB Assignment Resp: Unexpected transport layer 
address size %u\n",
                             item->transportLayerAddress->size);
-                       return -1;
+                       goto ret_error;
                }
                require_pdp_update = true;
        }
@@ -125,6 +126,15 @@
        }
        return 0;

+ret_error:
+       if (pdp->state != PDP_STATE_CR_CONF) {
+               gsm48_tx_gsm_act_pdp_rej(ctx, pdp->ti, GSM_CAUSE_NET_FAIL,
+                                        0, NULL);
+               sgsn_delete_pdp_ctx(pdp);
+       } else {
+               gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL, true);
+       }
+       return -1;
 }

 int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum 
ranap_iu_event_type type, void *data)

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/38436?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I111cc4b17100d2e1ef756b654dc9e98415b3a8bb
Gerrit-Change-Number: 38436
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: lynxis lazus <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to