From ff2aed59072aff0fad97203cf28cef0e9d11cb7d Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 15 Sep 2021 12:09:32 -0400 Subject: [PATCH] TT#14008 avoid confirm/unconfirm/reconfig flip-flop Distinguish between unconfirming the learned peer address and retriggering the kernel stream. In particular we don't want to unconfirm the sinks every time we confirmed our own peer, as that starts an unconfirm/reconfirm loop. Change-Id: I1f172385aefeacbc4585729bce25fbc68f04c2bd --- daemon/media_socket.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/media_socket.c b/daemon/media_socket.c index a4d331f99..3b36d4b49 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -64,6 +64,7 @@ struct packet_handler_ctx { // verdicts: int update; // true if Redis info needs to be updated int unkernelize; // true if stream ought to be removed from kernel + int unconfirm; // forget learned peer address int unkernelize_subscriptions; // if our peer address changed int kernelize; // true if stream can be kernelized int rtcp_discard; // do not forward RTCP @@ -1962,6 +1963,7 @@ static int media_packet_address_check(struct packet_handler_ctx *phc) ilog(LOG_INFO | LOG_FLAG_LIMIT, "Peer address changed to %s%s%s", FMT_M(endpoint_print_buf(&phc->mp.fsin))); phc->unkernelize = 1; + phc->unconfirm = 1; phc->update = 1; phc->mp.stream->endpoint = phc->mp.fsin; goto update_addr; @@ -2034,7 +2036,6 @@ static int media_packet_address_check(struct packet_handler_ctx *phc) confirm_now: phc->kernelize = 1; phc->update = 1; - phc->unkernelize_subscriptions = 1; ilog(LOG_INFO, "Confirmed peer address as %s%s%s", FMT_M(endpoint_print_buf(use_endpoint_confirm))); @@ -2406,7 +2407,7 @@ drop: handler_ret = 0; out: - if (phc->unkernelize) { + if (phc->unconfirm) { stream_unconfirm(phc->mp.stream); unconfirm_sinks(&phc->mp.stream->rtp_sinks); unconfirm_sinks(&phc->mp.stream->rtcp_sinks);