Change in libosmocore[master]: gprs_ns2: don't pass the return code of reject_status_msg

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Tue Dec 15 00:58:49 UTC 2020


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/21725 )


Change subject: gprs_ns2: don't pass the return code of reject_status_msg
......................................................................

gprs_ns2: don't pass the return code of reject_status_msg

When reject_stats_msg() fails the code can't do anything about it.
Stick to the original failure code and log it

Change-Id: I105363957e59c41a68835b7a9830c048dba73e93
---
M src/gb/gprs_ns2.c
1 file changed, 4 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/25/21725/1

diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index 0355d83..53a4baa 100644
--- a/src/gb/gprs_ns2.c
+++ b/src/gb/gprs_ns2.c
@@ -805,18 +805,13 @@
 			break;
 
 		rc = reject_status_msg(msg, &tp, reject, NS_CAUSE_PDU_INCOMP_PSTATE);
-		if (rc < 0) {
+		if (rc < 0)
 			LOGP(DLNS, LOGL_ERROR, "Failed to generate reject message (%d)\n", rc);
-			return rc;
-		}
 		return GPRS_NS2_CS_REJECTED;
 	default:
 		rc = reject_status_msg(msg, &tp, reject, NS_CAUSE_PDU_INCOMP_PSTATE);
-
-		if (rc < 0) {
+		if (rc < 0)
 			LOGP(DLNS, LOGL_ERROR, "Failed to generate reject message (%d)\n", rc);
-			return rc;
-		}
 		return GPRS_NS2_CS_REJECTED;
 	}
 
@@ -834,6 +829,8 @@
 	    !TLVP_PRES_LEN(&tp, NS_IE_VCI, 2) || !TLVP_PRES_LEN(&tp, NS_IE_NSEI, 2)) {
 		LOGP(DLNS, LOGL_ERROR, "NS RESET Missing mandatory IE\n");
 		rc = reject_status_msg(msg, &tp, reject, NS_CAUSE_MISSING_ESSENT_IE);
+		if (rc < 0)
+			LOGP(DLNS, LOGL_ERROR, "Failed to generate reject message (%d)\n", rc);
 		return GPRS_NS2_CS_REJECTED;
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21725
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I105363957e59c41a68835b7a9830c048dba73e93
Gerrit-Change-Number: 21725
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201215/a05390aa/attachment.htm>


More information about the gerrit-log mailing list