pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/27413 )
Change subject: gtp: Use switch statement in gtp_create_pdp_ind() ......................................................................
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 --- M gtp/gtp.c 1 file changed, 6 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/13/27413/1
diff --git a/gtp/gtp.c b/gtp/gtp.c index 829d2d2..3051255 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -1554,7 +1554,8 @@ 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 @@ 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 @@ return gtp_create_pdp_resp(gsn, version, pdp, GTPCAUSE_MAN_IE_MISSING); } + break; }
/* SGSN address for signalling (mandatory) */