aboutsummaryrefslogtreecommitdiffstats
path: root/src/gb/gprs_ns.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-10-08 11:47:36 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-10-09 07:47:20 +0200
commit0540d839ace7811257793c383275b929768175a5 (patch)
tree8f44b8275844cc73927b971c7b8f52c4cfc8b5d7 /src/gb/gprs_ns.c
parentcdb85f58c5f10b5b340d4cf064a096bd6fc6409f (diff)
gprs-ns: Let gprs_nsvc_reset return a value
Currently gprs_nsvc_reset does not return any value. This patch changes the function to return an integer, where a value less than zero indicates an error. The value is taken from the gprs_ns_tx_reset function. In case of failure, an error message is logged. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/gb/gprs_ns.c')
-rw-r--r--src/gb/gprs_ns.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c
index ee2d7ec7..cf7adaf1 100644
--- a/src/gb/gprs_ns.c
+++ b/src/gb/gprs_ns.c
@@ -1495,20 +1495,25 @@ int gprs_ns_nsip_listen(struct gprs_ns_inst *nsi)
* will not only send a NS-RESET, but also set the state to BLOCKED and
* start the Tns-reset timer.
*/
-void gprs_nsvc_reset(struct gprs_nsvc *nsvc, uint8_t cause)
+int gprs_nsvc_reset(struct gprs_nsvc *nsvc, uint8_t cause)
{
+ int rc;
+
LOGP(DNS, LOGL_INFO, "NSEI=%u RESET procedure based on API request\n",
nsvc->nsei);
/* Mark NS-VC locally as blocked and dead */
nsvc->state = NSE_S_BLOCKED;
/* Send NS-RESET PDU */
- if (gprs_ns_tx_reset(nsvc, cause) < 0) {
+ rc = gprs_ns_tx_reset(nsvc, cause);
+ if (rc < 0) {
LOGP(DNS, LOGL_ERROR, "NSEI=%u, error resetting NS-VC\n",
nsvc->nsei);
}
/* Start Tns-reset */
nsvc_start_timer(nsvc, NSVC_TIMER_TNS_RESET);
+
+ return rc;
}
/*! \brief Establish a NS connection (from the BSS) to the SGSN