<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/9934">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_rtp_asterisk.c: Fix unused variable warnings<br><br>Compiling without SRTP support installed resulted in some unused variable<br>warnings. These warnings also showed that the srtp variable was obtained<br>and passed around some functions but not really used even when a system<br>has SRTP installed.<br><br>Change-Id: I6daad34be3e89b19adef6e2fbe738018975155fc<br>---<br>M res/res_rtp_asterisk.c<br>1 file changed, 8 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/34/9934/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c</span><br><span>index 1d1d66e..fa9e325 100644</span><br><span>--- a/res/res_rtp_asterisk.c</span><br><span>+++ b/res/res_rtp_asterisk.c</span><br><span>@@ -2629,7 +2629,7 @@</span><br><span> return 0;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static int dtls_srtp_add_local_ssrc(struct ast_rtp *rtp, struct ast_srtp *srtp, struct ast_rtp_instance *instance, int rtcp, unsigned int ssrc, int set_remote_policy)</span><br><span style="color: hsl(120, 100%, 40%);">+static int dtls_srtp_add_local_ssrc(struct ast_rtp *rtp, struct ast_rtp_instance *instance, int rtcp, unsigned int ssrc, int set_remote_policy)</span><br><span> {</span><br><span> unsigned char material[SRTP_MASTER_LEN * 2];</span><br><span> unsigned char *local_key, *local_salt, *remote_key, *remote_salt;</span><br><span>@@ -2709,7 +2709,7 @@</span><br><span> return res;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static int dtls_srtp_setup(struct ast_rtp *rtp, struct ast_srtp *srtp, struct ast_rtp_instance *instance, int rtcp)</span><br><span style="color: hsl(120, 100%, 40%);">+static int dtls_srtp_setup(struct ast_rtp *rtp, struct ast_rtp_instance *instance, int rtcp)</span><br><span> {</span><br><span> struct dtls_details *dtls = !rtcp ? &rtp->dtls : &rtp->rtcp->dtls;</span><br><span> int index;</span><br><span>@@ -2751,14 +2751,14 @@</span><br><span> X509_free(certificate);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (dtls_srtp_add_local_ssrc(rtp, srtp, instance, rtcp, ast_rtp_instance_get_ssrc(instance), 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (dtls_srtp_add_local_ssrc(rtp, instance, rtcp, ast_rtp_instance_get_ssrc(instance), 1)) {</span><br><span> return -1;</span><br><span> }</span><br><span> </span><br><span> for (index = 0; index < AST_VECTOR_SIZE(&rtp->ssrc_mapping); ++index) {</span><br><span> struct rtp_ssrc_mapping *mapping = AST_VECTOR_GET_ADDR(&rtp->ssrc_mapping, index);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (dtls_srtp_add_local_ssrc(rtp, srtp, instance, rtcp, ast_rtp_instance_get_ssrc(mapping->instance), 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (dtls_srtp_add_local_ssrc(rtp, instance, rtcp, ast_rtp_instance_get_ssrc(mapping->instance), 0)) {</span><br><span> return -1;</span><br><span> }</span><br><span> }</span><br><span>@@ -2825,8 +2825,9 @@</span><br><span> {</span><br><span> int len;</span><br><span> struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);</span><br><span style="color: hsl(0, 100%, 40%);">- struct ast_srtp *srtp = ast_rtp_instance_get_srtp(instance, rtcp);</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span> char *in = buf;</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span> #ifdef HAVE_PJPROJECT</span><br><span> struct ast_sockaddr *loop = rtcp ? &rtp->rtcp_loop : &rtp->rtp_loop;</span><br><span> #endif</span><br><span>@@ -2887,7 +2888,7 @@</span><br><span> /* Any further connections will be existing since this is now established */</span><br><span> dtls->connection = AST_RTP_DTLS_CONNECTION_EXISTING;</span><br><span> /* Use the keying material to set up key/salt information */</span><br><span style="color: hsl(0, 100%, 40%);">- if ((res = dtls_srtp_setup(rtp, srtp, instance, rtcp))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if ((res = dtls_srtp_setup(rtp, instance, rtcp))) {</span><br><span> return res;</span><br><span> }</span><br><span> /* Notify that dtls has been established */</span><br><span>@@ -7782,7 +7783,7 @@</span><br><span> * negotiation has been completed.</span><br><span> */</span><br><span> if (parent_rtp->dtls.connection == AST_RTP_DTLS_CONNECTION_EXISTING) {</span><br><span style="color: hsl(0, 100%, 40%);">- dtls_srtp_add_local_ssrc(parent_rtp, ast_rtp_instance_get_srtp(parent, 0), parent, 0, child_rtp->ssrc, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+ dtls_srtp_add_local_ssrc(parent_rtp, parent, 0, child_rtp->ssrc, 0);</span><br><span> }</span><br><span> #endif</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9934">change 9934</a>. To unsubscribe, or for help writing mail filters, 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/9934"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I6daad34be3e89b19adef6e2fbe738018975155fc </div>
<div style="display:none"> Gerrit-Change-Number: 9934 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>