Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not kernelize rtp streams without confirmed SSRC #1855

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion daemon/media_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,7 @@ static void media_packet_rtp_in(struct packet_handler_ctx *phc)

const char *unkern = NULL;

if (G_LIKELY(!phc->rtcp && !rtp_payload(&phc->mp.rtp, &phc->mp.payload, &phc->s))) {
if (G_LIKELY(!phc->rtcp && (phc->mp.rtp?1:!rtp_payload(&phc->mp.rtp, &phc->mp.payload, &phc->s)))) {
unkern = __stream_ssrc_in(phc->in_srtp, phc->mp.rtp->ssrc, &phc->mp.ssrc_in,
phc->mp.media->monologue->ssrc_hash);

Expand Down Expand Up @@ -2315,6 +2315,19 @@ static bool media_packet_address_check(struct packet_handler_ctx *phc)
"peer address confirmation purposes",
FMT_M(endpoint_print_buf(&phc->mp.fsin)));
goto out;
} else if(proto_is_rtp(phc->mp.media->protocol)) {
if(rtp_payload(&phc->mp.rtp, &phc->mp.payload, &phc->s) != 0) {
ilog(LOG_INFO | LOG_FLAG_LIMIT, "Ignoring invalid RTP packet from %s%s%s for "
"peer address confirmation purposes",
FMT_M(endpoint_print_buf(&phc->mp.fsin)));
goto out;
}
if(!phc->mp.rtp->ssrc) {
ilog(LOG_INFO | LOG_FLAG_LIMIT, "Ignoring RTP packet with zero SSRC from %s%s%s for "
"peer address confirmation purposes",
FMT_M(endpoint_print_buf(&phc->mp.fsin)));
goto out;
}
}
}

Expand Down
Loading