Browse Source

MT#63317 allow alternative endpoints

for strict-source + bundle

Change-Id: Ic13a9a7fe45b671eff12473c70233c2d05ace371
rfuchs/dtls-ice
Richard Fuchs 3 months ago
parent
commit
ffd362cbf4
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      daemon/media_socket.c

+ 10
- 0
daemon/media_socket.c View File

@ -66,6 +66,7 @@ struct packet_handler_ctx {
sink_handler_q *sinks; // where to send output packets to (forward destination)
rewrite_func decrypt_func, encrypt_func; // handlers for decrypt/encrypt
rtcp_filter_func *rtcp_filter;
struct packet_stream *orig_stream; // saved input stream in case of demux change
struct packet_stream *in_srtp, *out_srtp; // SRTP contexts for decrypt/encrypt (relevant for muxed RTCP)
int payload_type; // -1 if unknown or not RTP
bool rtcp; // true if this is an RTCP packet
@ -2823,6 +2824,7 @@ static void media_packet_demux_pt(struct packet_handler_ctx *phc) {
// sets in_srtp and sinks
static void media_packet_set_streams(struct packet_handler_ctx *phc) {
phc->orig_stream = phc->mp.stream;
phc->in_srtp = phc->mp.stream;
phc->sinks = &phc->mp.stream->rtp_sinks;
@ -3175,6 +3177,14 @@ static bool media_packet_address_check(struct packet_handler_ctx *phc)
goto update_addr;
}
// try some other options before dropping
if (!matched && !MEDIA_ISSET(phc->mp.media, ASYMMETRIC))
matched = memcmp(&phc->mp.fsin, &phc->orig_stream->endpoint,
sizeof(phc->mp.fsin)) == 0;
if (!matched)
matched = memcmp(&phc->mp.fsin, &phc->orig_stream->learned_endpoint,
sizeof(phc->mp.fsin)) == 0;
if (!matched && PS_ISSET(phc->mp.stream, STRICT_SOURCE)) {
ilog(LOG_INFO | LOG_FLAG_LIMIT, "Drop due to strict-source attribute; "
"got %s%s%s, "


Loading…
Cancel
Save