diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-03-07 11:34:28 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-03-07 11:34:30 +0100 |
commit | fb9303c610f318dfcaa5a0e2a1d54cd2deb22d8c (patch) | |
tree | dbfae9da473cba9e26472aeb727d6a8a920e89dd | |
parent | 05857697419a75de58e203e3085943d78f493d56 (diff) |
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
-rw-r--r-- | gtp/gtp.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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) */ |