Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available.

lynxis lazus gerrit-no-reply at
Wed May 8 13:00:26 UTC 2019

lynxis lazus has posted comments on this change. ( )

Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available.

Patch Set 7:

File src/gprs/gprs_gmm.c:
PS7, Line 1618: 
              : bool pdp_status_has_no_active_nsapis(const uint8_t *pdp_status, const size_t pdp_status_len)
              : {
              : 	size_t i;
              : 	for (i = 0; i < pdp_status_len; i++)
              : 		if (pdp_status[i] != 0)
              : 			return false;
              : 	return true;
              : }
Can you rename it to pdp_status_has_active_nsapis?
It would also mean you have to swap the logic. A positive check is more readable as a negation check.
PS7, Line 1629: /* 3GPP TS 24.008 Section Service request procedure not accepted by the
              :  * network. Returns true if MS has active PDP contexts in pdp_status but SGSN
              :  * has none */
              : bool ms_has_active_pdp_and_sgsn_has_none(struct sgsn_mm_ctx *mmctx,
              : 					 const uint8_t *pdp_status,
              : 					 const size_t pdp_status_len)
              : {
              : 	if (!llist_empty(&mmctx->pdp_list))
              : 		return false;
              : 	return !pdp_status_has_no_active_nsapis(pdp_status, pdp_status_len);
              : }
Can you remove this function. Doing another redirection of a function just for this single case seems to be confusing.
Or do you plan do add this check more often? If so I would like to rename this function to check_pdp_status()
PS7, Line 1935: ms_has_active_pdp_and_sgsn_has_none(ctx, pdp_status, pdp_status_len)
do a llist_empty(..) && pdp_status_has_active_nsapis()

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437
Gerrit-Change-Number: 13744
Gerrit-PatchSet: 7
Gerrit-Owner: Mykola Shchetinin <mykola at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Mykola Shchetinin <mykola at>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at>
Gerrit-Reviewer: lynxis lazus <lynxis at>
Gerrit-Comment-Date: Wed, 08 May 2019 13:00:26 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list