<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7537">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Benjamin Keith Ford: Looks good to me, but someone else must approve
Corey Farrell: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_sip: Don't send trailing \0 on keep alive packets<br><br>This is a partial fix for ASTERISK~25817 but does not address the<br>comments regarding RFC 5626.<br><br>Change-Id: I227e2d10c0035bbfa1c6e46ae2318fd1122d8420<br>---<br>M channels/chan_sip.c<br>1 file changed, 5 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/channels/chan_sip.c b/channels/chan_sip.c<br>index b8cc7bf..6432728 100644<br>--- a/channels/chan_sip.c<br>+++ b/channels/chan_sip.c<br>@@ -30068,6 +30068,7 @@<br> struct sip_peer *peer = (struct sip_peer*) data;<br> int res = 0;<br> const char keepalive[] = "\r\n";<br>+ size_t count = sizeof(keepalive) - 1;<br> <br> peer->keepalivesend = -1;<br> <br>@@ -30078,13 +30079,13 @@<br> <br> /* Send the packet out using the proper method for this peer */<br> if ((peer->socket.fd != -1) && (peer->socket.type == AST_TRANSPORT_UDP)) {<br>- res = ast_sendto(peer->socket.fd, keepalive, sizeof(keepalive), 0, &peer->addr);<br>+ res = ast_sendto(peer->socket.fd, keepalive, count, 0, &peer->addr);<br> } else if ((peer->socket.type & (AST_TRANSPORT_TCP | AST_TRANSPORT_TLS)) &&<br> (peer->socket.tcptls_session) &&<br> (peer->socket.tcptls_session->fd != -1)) {<br>- res = sip_tcptls_write(peer->socket.tcptls_session, keepalive, sizeof(keepalive));<br>+ res = sip_tcptls_write(peer->socket.tcptls_session, keepalive, count);<br> } else if (peer->socket.type == AST_TRANSPORT_UDP) {<br>- res = ast_sendto(sipsock, keepalive, sizeof(keepalive), 0, &peer->addr);<br>+ res = ast_sendto(sipsock, keepalive, count, 0, &peer->addr);<br> }<br> <br> if (res == -1) {<br>@@ -30098,7 +30099,7 @@<br> }<br> }<br> <br>- if (res != sizeof(keepalive)) {<br>+ if (res != count) {<br> ast_log(LOG_WARNING, "sip_send_keepalive to %s returned %d: %s\n", ast_sockaddr_stringify(&peer->addr), res, strerror(errno));<br> }<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7537">change 7537</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/7537"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I227e2d10c0035bbfa1c6e46ae2318fd1122d8420 </div>
<div style="display:none"> Gerrit-Change-Number: 7537 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>