[Asterisk-code-review] chan sip.c: chan sip unstable with TLS after asterisk start ... (asterisk[15])
George Joseph
asteriskteam at digium.com
Mon Sep 24 10:45:21 CDT 2018
George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/10040 )
Change subject: chan_sip.c: chan_sip unstable with TLS after asterisk start or reloads
......................................................................
chan_sip.c: chan_sip unstable with TLS after asterisk start or reloads
Fixes random asterisk crash on start or reload with TLS phones.
ASTERISK-28034 #close
Reported-by: David Hajek
Change-Id: I2a859f97dc80c348e2fa56e918214ee29521c4ac
---
M channels/chan_sip.c
1 file changed, 6 insertions(+), 2 deletions(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Richard Mudgett: Looks good to me, but someone else must approve
Matthew Fredrickson: Looks good to me, approved
George Joseph: Approved for Submit
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 34b361c..ab383d7 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2575,7 +2575,8 @@
ao2_lock(tcptls_session);
- if (!(th = ao2_t_find(threadt, &tmp, OBJ_POINTER, "ao2_find, getting sip_threadinfo in tcp helper thread")) ||
+ if (!tcptls_session->stream ||
+ !(th = ao2_t_find(threadt, &tmp, OBJ_POINTER, "ao2_find, getting sip_threadinfo in tcp helper thread")) ||
!(packet = ao2_alloc(sizeof(*packet), tcptls_packet_destructor)) ||
!(packet->data = ast_str_create(len))) {
goto tcptls_write_setup_error;
@@ -3097,7 +3098,7 @@
if (read(me->alert_pipe[0], &alert, sizeof(alert)) == -1) {
ast_log(LOG_ERROR, "read() failed: %s\n", strerror(errno));
- continue;
+ goto cleanup;
}
switch (alert) {
@@ -3115,10 +3116,13 @@
ast_log(LOG_WARNING, "Failure to write to tcp/tls socket\n");
}
ao2_t_ref(packet, -1, "tcptls packet sent, this is no longer needed");
+ } else {
+ goto cleanup;
}
break;
default:
ast_log(LOG_ERROR, "Unknown tcptls thread alert '%u'\n", alert);
+ goto cleanup;
}
}
}
--
To view, visit https://gerrit.asterisk.org/10040
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I2a859f97dc80c348e2fa56e918214ee29521c4ac
Gerrit-Change-Number: 10040
Gerrit-PatchSet: 3
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: David Hajek <david.hajek at daktela.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180924/231a5f5e/attachment.html>
More information about the asterisk-code-review
mailing list