Skip to content

Commit

Permalink
ranap: Reject ActivatePDPCtx from UE if RABAssResp parsing fails
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pespin committed Oct 16, 2024
1 parent 3087322 commit 6213201
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/sgsn/gprs_ranap.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ static int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrMod
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;
}

Expand All @@ -81,7 +82,7 @@ static int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrMod
"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) {
Expand All @@ -92,12 +93,12 @@ static int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrMod
/* 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;
}
Expand Down Expand Up @@ -125,6 +126,15 @@ static int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrMod
}
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)
Expand Down

0 comments on commit 6213201

Please sign in to comment.