On Tue, Oct 16, 2012 at 01:11:34PM +0200, Lennart Müller wrote:
[...]
> Hi Pablo,
> thanks for the patch.
> msgb_free(msg); causes signal 6, I tried the following and it works,
> but might cause a memory leak...
>
> if (e1i_ts->line->ops->sign_link(msg) < 0) {
> /* Don't close the signalling link if the upper layers report
> * an error, that's too strict.
> */
> LOGP(DLINP, LOGL_ERROR, "Bad signalling message,"
> "sign_link returned error\n");
> ret = -EINVAL;
> //msgb_free(msg);
> return(ret);
I see. I guess you were hitting SIGABRT also before the patch then.
New patch attached. If you're OK with it, I'll push it to git.
>From 1de9714989fd0f911f2a66f08cac111e354b5795 Mon Sep 17 00:00:00 2001
From: Pablo Neira Ayuso <[email protected]>
Date: Tue, 16 Oct 2012 11:24:08 +0200
Subject: [PATCH] ipaccess: relax default behaviour on errors coming from
signalling layer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This patch relaxes the behaviour on error coming from the signalling
layer. This is probably too strict for recoverable errors.
Don't release msgb in this case, as this is controled by the signaling link
layer.
Thanks to Lennart Müller <[email protected]> for the report.
---
src/input/ipaccess.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index d63e796..c0c307e 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -450,10 +450,13 @@ static int handle_ts1_read(struct osmo_fd *bfd)
goto err_msg;
}
if (e1i_ts->line->ops->sign_link(msg) < 0) {
+ /* Don't close the signalling link if the upper layers report
+ * an error, that's too strict. BTW, the signalling layer is
+ * resposible for releasing the message.
+ */
LOGP(DLINP, LOGL_ERROR, "Bad signalling message,"
"sign_link returned error\n");
ret = -EINVAL;
- goto err;
}
return 0;
--
1.7.10.4