diff options
authorJacob Erlbeck <>2015-01-19 10:56:15 +0100
committerJacob Erlbeck <>2015-01-19 15:10:57 +0100
commitcedc73bf6346353e6c04a2ace9986a99cfa30475 (patch)
parent870f7c20e1af47129ab055b72c288919cb89f6fc (diff)
gprs: Return 0 from gsup_client_connect if ok or retry timer enabled
Currently the gsup_client_connect return 0 if the call to ipa_client_conn_open was successful and -errno otherwise. This makes it difficult for the caller to determine, whether the the whole operation has been cancelled (currently on EBADF, ENOTSOCK, EAFNOSUPPORT, EINVAL) or whether the GSUP client will retry to connect after a timeout. This will cause gprs_gsup_client_create to destroy the GSUP client object, even if the error might be temporary. This patch changes the function to return 0 if (and only if) ipa_client_conn_open was successful or the retry timer has been started. Since the return value 0 doesn't guarantee, that a subsequent call to gprs_gsup_client_send will succeed, this shouldn't break anything. Sponsored-by: On-Waves ehf
1 files changed, 4 insertions, 1 deletions
diff --git a/openbsc/src/gprs/gprs_gsup_client.c b/openbsc/src/gprs/gprs_gsup_client.c
index 523c541b7..f6e18c9fe 100644
--- a/openbsc/src/gprs/gprs_gsup_client.c
+++ b/openbsc/src/gprs/gprs_gsup_client.c
@@ -84,7 +84,10 @@ static int gsup_client_connect(struct gprs_gsup_client *gsupc)
osmo_timer_schedule(&gsupc->connect_timer, GPRS_GSUP_RECONNECT_INTERVAL, 0);
- return rc;
+ LOGP(DGPRS, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n",
+ gsupc->link->addr, gsupc->link->port);
+ return 0;
static void connect_timer_cb(void *gsupc_)