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 <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41794}
This commit is contained in:
Philipp Hancke 2024-02-23 08:11:56 +01:00 committed by WebRTC LUCI CQ
parent efbfc40029
commit 845d6bef52

View File

@ -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<TransportDescription> 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<TransportDescription> 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<TransportDescription> 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,