aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-08-28 17:37:59 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-08-28 18:08:59 +0200
commit7ad2b15bc767f471ae12d4d72b5c734bde163d2a (patch)
tree50d9c1185b49d6800de58cb167c7bd967a593c22
parent082876bb65341d05263829664d3de0aa8dd4a874 (diff)
ipaccess: Return -EBADF when closing socket in ipaccess_bts_read_cb
As we are closing the socket, there's no need for lower layers to continue handling it, so let's return -EBADF. Change-Id: I961b0ef7e598a09ce48a83038c0d90a415e0e11c
-rw-r--r--src/input/ipaccess.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index cce1654..24a79ea 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -738,7 +738,6 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg)
LOGP(DLINP, LOGL_ERROR,
"Unable to set signal link, "
"closing socket.\n");
- ret = -EINVAL;
goto err;
}
}
@@ -758,7 +757,6 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg)
LOGP(DLINP, LOGL_ERROR,
"Unable to set signal link, "
"closing socket.\n");
- ret = -EINVAL;
goto err;
}
}
@@ -774,16 +772,14 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg)
if (e1i_ts->type == E1INP_TS_TYPE_NONE) {
LOGP(DLINP, LOGL_ERROR, "Signalling link not initialized. Discarding."
" port=%u msg_type=%u\n", link->port, msg_type);
- ret = -EIO;
goto err;
}
-
+
/* look up for some existing signaling link. */
sign_link = e1inp_lookup_sign_link(e1i_ts, hh->proto, 0);
if (sign_link == NULL) {
LOGP(DLINP, LOGL_ERROR, "no matching signalling link for "
"hh->proto=0x%02x\n", hh->proto);
- ret = -EIO;
goto err;
}
msg->dst = sign_link;
@@ -792,7 +788,6 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg)
if (!link->line->ops->sign_link) {
LOGP(DLINP, LOGL_ERROR, "Fix your application, "
"no action set for signalling messages.\n");
- ret = -ENOENT;
goto err;
}
link->line->ops->sign_link(msg);
@@ -801,7 +796,7 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg)
err:
ipa_client_conn_close(link);
msgb_free(msg);
- return ret;
+ return -EBADF;
}
struct ipaccess_line {