From 845d6bef52ec08dfd9c87d3eff5ae5c07c3fe55d Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Fri, 23 Feb 2024 08:11:56 +0100 Subject: [PATCH] Fix handling of rejected m-lines without transport description A fingerprint should not be required for m-lines which are rejected. BUG=chromium:326493639,webrtc:11066 Change-Id: I7428c91a144ca46650e13d72868f160652a98339 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340322 Reviewed-by: Harald Alvestrand Reviewed-by: Florent Castelli Commit-Queue: Philipp Hancke Cr-Commit-Position: refs/heads/main@{#41794} --- pc/media_session.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pc/media_session.cc b/pc/media_session.cc index 4f63f3088f..3928088c7f 100644 --- a/pc/media_session.cc +++ b/pc/media_session.cc @@ -2174,12 +2174,12 @@ RTCError MediaSessionDescriptionFactory::AddRtpContentForAnswer( } // If this section is part of a bundle, bundle_transport is non-null. // Then require_transport_attributes is false - we can handle sections - // without the DTLS parameters. Otherwise, transport attributes MUST - // be present. + // without the DTLS parameters. For rejected m-lines it does not matter. + // Otherwise, transport attributes MUST be present. std::unique_ptr transport = CreateTransportAnswer( media_description_options.mid, offer_description, media_description_options.transport_options, current_description, - bundle_transport == nullptr, ice_credentials); + !offer_content->rejected && bundle_transport == nullptr, ice_credentials); if (!transport) { LOG_AND_RETURN_ERROR( RTCErrorType::INTERNAL_ERROR, @@ -2272,7 +2272,7 @@ RTCError MediaSessionDescriptionFactory::AddDataContentForAnswer( std::unique_ptr data_transport = CreateTransportAnswer( media_description_options.mid, offer_description, media_description_options.transport_options, current_description, - bundle_transport != nullptr, ice_credentials); + !offer_content->rejected && bundle_transport == nullptr, ice_credentials); if (!data_transport) { LOG_AND_RETURN_ERROR( RTCErrorType::INTERNAL_ERROR, @@ -2344,10 +2344,11 @@ RTCError MediaSessionDescriptionFactory::AddUnsupportedContentForAnswer( SessionDescription* answer, IceCredentialsIterator* ice_credentials) const { std::unique_ptr unsupported_transport = - CreateTransportAnswer(media_description_options.mid, offer_description, - media_description_options.transport_options, - current_description, bundle_transport != nullptr, - ice_credentials); + CreateTransportAnswer( + media_description_options.mid, offer_description, + media_description_options.transport_options, current_description, + !offer_content->rejected && bundle_transport == nullptr, + ice_credentials); if (!unsupported_transport) { LOG_AND_RETURN_ERROR( RTCErrorType::INTERNAL_ERROR,