From: Pablo Neira Ayuso <pablo(a)gnumonks.org>
If we hit any error in the receival path of the ipaccess input
driver, then better spot an error containing the reason and close
the socket to start over.
---
src/input/ipaccess.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 44a5a59..31b8f04 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -387,9 +387,13 @@ static int handle_ts1_read(struct osmo_fd *bfd)
int ret = 0, error;
error = ipa_msg_recv(bfd->fd, &msg);
- if (error < 0)
+ if (error < 0) {
+ if (ipaccess_drop(bfd) >= 0) {
+ LOGP(DLINP, LOGL_NOTICE, "Sign link problems, "
+ "closing socket. Reason: %s\n", strerror(errno));
+ }
return error;
- else if (error == 0) {
+ } else if (error == 0) {
if (ipaccess_drop(bfd) >= 0) {
LOGP(DLINP, LOGL_NOTICE, "Sign link vanished, "
"dead socket\n");
--
1.7.10.4