Browse Source

TT#14008 add extra logging for SRTP/SSRC updates

Change-Id: I564193c919563ec14c61db1031f696d5029e6e40
(cherry picked from commit 014301bee8)
(cherry picked from commit be4cfb7c54)
mr10.2.1
Richard Fuchs 4 years ago
parent
commit
1049b78abd
2 changed files with 24 additions and 14 deletions
  1. +14
    -2
      daemon/call.c
  2. +10
    -12
      kernel-module/xt_RTPENGINE.c

+ 14
- 2
daemon/call.c View File

@ -591,6 +591,8 @@ void call_timer(void *ptr) {
if (!sfd) if (!sfd)
goto next; goto next;
log_info_stream_fd(sfd);
rwlock_lock_r(&sfd->call->master_lock); rwlock_lock_r(&sfd->call->master_lock);
ps = sfd->stream; ps = sfd->stream;
@ -669,6 +671,10 @@ void call_timer(void *ptr) {
if (sink->crypto.params.crypto_suite if (sink->crypto.params.crypto_suite
&& o->encrypt.last_index[u] - ctx->srtp_index > 0x4000) && o->encrypt.last_index[u] - ctx->srtp_index > 0x4000)
{ {
ilog(LOG_DEBUG, "Updating SRTP encryption index from %" PRIu64
" to %" PRIu64,
ctx->srtp_index,
o->encrypt.last_index[u]);
ctx->srtp_index = o->encrypt.last_index[u]; ctx->srtp_index = o->encrypt.last_index[u];
update = true; update = true;
} }
@ -688,12 +694,17 @@ void call_timer(void *ptr) {
atomic64_add(&ctx->octets, diff_bytes); atomic64_add(&ctx->octets, diff_bytes);
atomic64_add(&ctx->packets, diff_packets); atomic64_add(&ctx->packets, diff_packets);
atomic64_set(&ctx->last_seq, ke->target.decrypt.last_index[u]); atomic64_set(&ctx->last_seq, ke->target.decrypt.last_index[u]);
ctx->srtp_index = ke->target.decrypt.last_index[u];
if (sfd->crypto.params.crypto_suite if (sfd->crypto.params.crypto_suite
&& ke->target.decrypt.last_index[u] && ke->target.decrypt.last_index[u]
- ctx->srtp_index > 0x4000)
- ctx->srtp_index > 0x4000) {
ilog(LOG_DEBUG, "Updating SRTP decryption index from %" PRIu64
" to %" PRIu64,
ctx->srtp_index,
ke->target.decrypt.last_index[u]);
ctx->srtp_index = ke->target.decrypt.last_index[u];
update = true; update = true;
}
} }
mutex_unlock(&ps->in_lock); mutex_unlock(&ps->in_lock);
} }
@ -709,6 +720,7 @@ next:
i = g_list_delete_link(i, i); i = g_list_delete_link(i, i);
if (sfd) if (sfd)
obj_put(sfd); obj_put(sfd);
log_info_pop();
} }
l = g_hash_table_get_values(hlp.addr_sfd); l = g_hash_table_get_values(hlp.addr_sfd);


+ 10
- 12
kernel-module/xt_RTPENGINE.c View File

@ -1591,10 +1591,10 @@ static void proc_list_crypto_print(struct seq_file *f, struct re_crypto_context
seq_printf(f, " ROC:"); seq_printf(f, " ROC:");
for (i = 0; i < ARRAY_SIZE(c->roc); i++) { for (i = 0; i < ARRAY_SIZE(c->roc); i++) {
if (i == 0)
seq_printf(f, " %u", (unsigned int) c->roc[i]);
else
seq_printf(f, ", %u", (unsigned int) c->roc[i]);
seq_printf(f, "%s %u (%lu)",
(i == 0) ? "" : ",",
(unsigned int) c->roc[i],
(unsigned long) s->last_index[i]);
} }
seq_printf(f, "\n"); seq_printf(f, "\n");
@ -1652,10 +1652,9 @@ static int proc_list_show(struct seq_file *f, void *v) {
for (i = 0; i < ARRAY_SIZE(g->target.ssrc); i++) { for (i = 0; i < ARRAY_SIZE(g->target.ssrc); i++) {
if (!g->target.ssrc[i]) if (!g->target.ssrc[i])
break; break;
if (i == 0)
seq_printf(f, " %lx", (unsigned long) ntohl(g->target.ssrc[i]));
else
seq_printf(f, ", %lx", (unsigned long) ntohl(g->target.ssrc[i]));
seq_printf(f, "%s %lx",
(i == 0) ? "" : ",",
(unsigned long) ntohl(g->target.ssrc[i]));
} }
seq_printf(f, "\n"); seq_printf(f, "\n");
@ -1685,10 +1684,9 @@ static int proc_list_show(struct seq_file *f, void *v) {
for (j = 0; j < ARRAY_SIZE(o->output.ssrc_out); j++) { for (j = 0; j < ARRAY_SIZE(o->output.ssrc_out); j++) {
if (!o->output.ssrc_out[j]) if (!o->output.ssrc_out[j])
break; break;
if (j == 0)
seq_printf(f, " %lx", (unsigned long) ntohl(o->output.ssrc_out[j]));
else
seq_printf(f, ", %lx", (unsigned long) ntohl(o->output.ssrc_out[j]));
seq_printf(f, "%s %lx",
(j == 0) ? "" : ",",
(unsigned long) ntohl(o->output.ssrc_out[j]));
} }
seq_printf(f, "\n"); seq_printf(f, "\n");


Loading…
Cancel
Save