From 435e5b62ffe01a70791821655a3277e4a730f3c2 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 8 Nov 2022 07:46:26 -0500 Subject: [PATCH] MT#55283 honour `pt_filter` flag Only skip forwarding unknown payload types in the kernel module if there's reason to skip them, i.e. when we know that certain payload types must be handled in userspace. Use an explicit flag to signal this to the kernel module instead of implicitly doing it for anything that is RTP. Change-Id: I655317afe64a27252bf7b8be6c78418db2e1ccef --- daemon/media_socket.c | 1 + kernel-module/xt_RTPENGINE.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/daemon/media_socket.c b/daemon/media_socket.c index d793ca078..9f27c6319 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -1281,6 +1281,7 @@ static const char *kernelize_one(struct rtpengine_target_info *reti, GQueue *out break; } if (!can_kernelize) { + reti->pt_filter = 1; // ensure that the final list in *payload_types reflects the payload // types populated in reti->payload_types GList *next = l->next; diff --git a/kernel-module/xt_RTPENGINE.c b/kernel-module/xt_RTPENGINE.c index 59f319c48..6bc041665 100644 --- a/kernel-module/xt_RTPENGINE.c +++ b/kernel-module/xt_RTPENGINE.c @@ -1676,6 +1676,8 @@ static int proc_list_show(struct seq_file *f, void *v) { proc_list_crypto_print(f, &g->decrypt, &g->target.decrypt, "decryption"); if (g->target.rtp) seq_printf(f, " option: RTP\n"); + if (g->target.pt_filter) + seq_printf(f, " option: PT filter\n"); if (g->target.rtp_only) seq_printf(f, " option: RTP only\n"); if (g->target.rtcp_mux) @@ -4605,8 +4607,8 @@ found_ssrc:; if (srtp_auth_validate(&g->decrypt, &g->target.decrypt, &rtp, &pkt_idx, ssrc_idx)) goto skip_error; - // if RTP, only forward packets of known/passthrough payload types - if (g->target.rtp && rtp_pt_idx < 0) + // only forward packets of known/passthrough payload types? + if (g->target.pt_filter && rtp_pt_idx < 0) goto skip1; errstr = "SRTP decryption failed";