gtp: Use switch statement in gtp_create_pdp_ind()

Double if had to be changed to if-else anyway, so let's simply use a
switch statement.

Change-Id: I91e8722947e58776742521d89abef8ae7584cb25
This commit is contained in:
Pau Espin 2022-03-07 11:34:28 +01:00
parent 0585769741
commit fb9303c610
1 changed files with 6 additions and 4 deletions

View File

@ -1554,7 +1554,8 @@ int gtp_create_pdp_ind(struct gsn_t *gsn, int version,
GTPCAUSE_INVALID_MESSAGE);
}
if (version == 1) {
switch (version) {
case 1:
/* Linked NSAPI (conditional) */
/* If included this is the Secondary PDP Context Activation Procedure */
/* In secondary activation IMSI is not included, so the context must be */
@ -1646,9 +1647,9 @@ int gtp_create_pdp_ind(struct gsn_t *gsn, int version,
if (gtpie_gettlv(ie, GTPIE_TFT, 0, &pdp->tft.l,
&pdp->tft.v, sizeof(pdp->tft.v))) {
}
}
/* if (version == 1) */
if (version == 0) {
break; /* version 1 */
case 0:
if (gtpie_gettv0(ie, GTPIE_QOS_PROFILE0, 0,
pdp->qos_req0, sizeof(pdp->qos_req0))) {
gsn->missing++;
@ -1671,6 +1672,7 @@ int gtp_create_pdp_ind(struct gsn_t *gsn, int version,
return gtp_create_pdp_resp(gsn, version, pdp,
GTPCAUSE_MAN_IE_MISSING);
}
break;
}
/* SGSN address for signalling (mandatory) */