[Asterisk-code-review] AST-2017-012: Place single RTCP report block at beginning of... (asterisk[15.1])
George Joseph
asteriskteam at digium.com
Wed Dec 13 08:29:26 CST 2017
George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/7555 )
Change subject: AST-2017-012: Place single RTCP report block at beginning of report.
......................................................................
AST-2017-012: Place single RTCP report block at beginning of report.
When the RTCP code was transitioned over to Stasis a code change
was made to keep track of how many reports are present. This count
controlled where report blocks were placed in the RTCP report.
If a compound RTCP packet was received this logic would incorrectly
place a report block in the wrong location resulting in a write
to an invalid location.
This change removes this counting logic and always places the report
block at the first position. If in the future multiple reports are
supported the logic can be extended but for now keeping a count
serves no purpose.
ASTERISK-27382
ASTERISK-27429
Change-Id: Iad6c8a9985c4b608ef493e19c421211615485116
(cherry picked from commit 6b3bbba6dd04aead17472662b45c30906b439176)
---
M res/res_rtp_asterisk.c
1 file changed, 3 insertions(+), 5 deletions(-)
Approvals:
Jenkins2: Verified
George Joseph: Looks good to me, approved; Approved for Submit
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 7bf5b00..907725f 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -4918,7 +4918,6 @@
unsigned int first_word;
/*! True if we have seen an acceptable SSRC to learn the remote RTCP address */
unsigned int ssrc_seen;
- int report_counter = 0;
struct ast_rtp_rtcp_report_block *report_block;
struct ast_frame *f = &ast_null_frame;
@@ -5162,7 +5161,7 @@
}
return &ast_null_frame;
}
- rtcp_report->report_block[report_counter] = report_block;
+ rtcp_report->report_block[0] = report_block;
report_block->source_ssrc = ntohl(rtcpheader[i]);
report_block->lost_count.packets = ntohl(rtcpheader[i + 1]) & 0x00ffffff;
report_block->lost_count.fraction = ((ntohl(rtcpheader[i + 1]) & 0xff000000) >> 24);
@@ -5199,7 +5198,6 @@
ast_verbose(" DLSR: %4.4f (sec)\n",(double)report_block->dlsr / 65536.0);
ast_verbose(" RTT: %4.4f(sec)\n", rtp->rtcp->rtt);
}
- report_counter++;
}
/* If and when we handle more than one report block, this should occur outside
* this loop.
@@ -5224,9 +5222,9 @@
/* There's always a single report block stored, here */
struct ast_rtp_rtcp_report *rtcp_report2;
report_block = transport_rtp->f.data.ptr + transport_rtp->f.datalen + sizeof(struct ast_rtp_rtcp_report_block *);
- memcpy(report_block, rtcp_report->report_block[report_counter-1], sizeof(struct ast_rtp_rtcp_report_block));
+ memcpy(report_block, rtcp_report->report_block[0], sizeof(struct ast_rtp_rtcp_report_block));
rtcp_report2 = (struct ast_rtp_rtcp_report *)transport_rtp->f.data.ptr;
- rtcp_report2->report_block[report_counter-1] = report_block;
+ rtcp_report2->report_block[0] = report_block;
transport_rtp->f.datalen += sizeof(struct ast_rtp_rtcp_report_block);
}
transport_rtp->f.offset = AST_FRIENDLY_OFFSET;
--
To view, visit https://gerrit.asterisk.org/7555
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15.1
Gerrit-MessageType: merged
Gerrit-Change-Id: Iad6c8a9985c4b608ef493e19c421211615485116
Gerrit-Change-Number: 7555
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171213/9d323b51/attachment.html>
More information about the asterisk-code-review
mailing list