From b70fe7277f56d2849593739bb12175dfe20e31cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Thu, 21 Nov 2024 13:28:48 +0100 Subject: [PATCH] Fix #1466 --- CHANGELOG.md | 2 ++ worker/src/RTC/PortManager.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4ada478b1..475ac95bcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ### NEXT +- `Worker`: Fix crash when using colliding `portRange` values in different transports ([PR #](https://github.com/versatica/mediasoup/pull/)). + ### 3.15.1 - Expose `extras` namespace which exports `EnhancedEventEmitter` and `enhancedOnce()` for now ([PR #1464](https://github.com/versatica/mediasoup/pull/1464)). diff --git a/worker/src/RTC/PortManager.cpp b/worker/src/RTC/PortManager.cpp index 557596dc04..6767ad7f24 100644 --- a/worker/src/RTC/PortManager.cpp +++ b/worker/src/RTC/PortManager.cpp @@ -678,8 +678,8 @@ namespace RTC // We want it in network order. const uint64_t address = bindAddrIn->sin_addr.s_addr; - hash = static_cast(minPort) << 48; - hash = static_cast(maxPort) << 32; + hash |= static_cast(minPort) << 48; + hash |= static_cast(maxPort) << 32; hash |= (address >> 2) << 2; hash |= 0x0000; // AF_INET. @@ -693,8 +693,8 @@ namespace RTC const auto address = a[0] ^ a[1] ^ a[2] ^ a[3]; - hash = static_cast(minPort) << 48; - hash = static_cast(maxPort) << 32; + hash |= static_cast(minPort) << 48; + hash |= static_cast(maxPort) << 32; hash |= static_cast(address) << 16; hash |= (static_cast(address) >> 2) << 2; hash |= 0x0002; // AF_INET6.