Skip to content

Commit d3ef4ed

Browse files
committed
MT#55283 allow RTCP APP for peer verification
Closes #2057 Change-Id: I069d12d8c7fd7ec36b77f1394fd9e8b928cdfd46
1 parent 256ad7b commit d3ef4ed

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

daemon/media_socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3128,7 +3128,7 @@ static bool media_packet_address_check(struct packet_handler_ctx *phc)
31283128
// confirmation purposes when needed. This is regardless of whether rtcp-mux
31293129
// is enabled or not.
31303130
if (!phc->mp.sfd->confirmed && PS_ISSET(phc->mp.stream, RTP)) {
3131-
if (rtcp_demux_is_rtcp(&phc->s)) {
3131+
if (rtcp_demux_is_rtcp(&phc->s) && rtcp_pt(&phc->s) != RTCP_PT_APP) {
31323132
ilog(LOG_DEBUG | LOG_FLAG_LIMIT, "Ignoring stray RTCP packet from %s%s%s for "
31333133
"peer address confirmation purposes",
31343134
FMT_M(endpoint_print_buf(&phc->mp.fsin)));

daemon/rtcp.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@
3636
#define SRTCP_R_LENGTH 6
3737
#endif
3838

39-
#define RTCP_PT_SR 200 /* sender report */
40-
#define RTCP_PT_RR 201 /* receiver report */
41-
#define RTCP_PT_SDES 202 /* source description */
42-
#define RTCP_PT_BYE 203 /* bye */
43-
#define RTCP_PT_APP 204 /* application specific */
44-
#define RTCP_PT_RTPFB 205 /* transport layer feedback message (RTP/AVPF) */
45-
#define RTCP_PT_PSFB 206 /* payload-specific feedback message (RTP/AVPF) */
46-
#define RTCP_PT_XR 207
47-
4839
#define SDES_TYPE_END 0
4940
#define SDES_TYPE_CNAME 1
5041
#define SDES_TYPE_NAME 2

lib/rtcplib.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
#include "compat.h"
77

88

9+
#define RTCP_PT_SR 200 /* sender report */
10+
#define RTCP_PT_RR 201 /* receiver report */
11+
#define RTCP_PT_SDES 202 /* source description */
12+
#define RTCP_PT_BYE 203 /* bye */
13+
#define RTCP_PT_APP 204 /* application specific */
14+
#define RTCP_PT_RTPFB 205 /* transport layer feedback message (RTP/AVPF) */
15+
#define RTCP_PT_PSFB 206 /* payload-specific feedback message (RTP/AVPF) */
16+
#define RTCP_PT_XR 207
17+
18+
919
struct rtcp_header {
1020
#if G_BYTE_ORDER == G_BIG_ENDIAN
1121
unsigned version:2; /**< packet type */
@@ -44,6 +54,9 @@ INLINE bool rtcp_demux_is_rtcp(const str *s) {
4454
return true;
4555
}
4656

47-
57+
INLINE unsigned char rtcp_pt(const str *s) {
58+
struct rtcp_packet *rtcp = (void *) s->s;
59+
return rtcp->header.pt;
60+
}
4861

4962
#endif

0 commit comments

Comments
 (0)