Skip to content

Commit

Permalink
Fix #1466
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Nov 21, 2024
1 parent 35ced8f commit b70fe72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)).
Expand Down
8 changes: 4 additions & 4 deletions worker/src/RTC/PortManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,8 @@ namespace RTC
// We want it in network order.
const uint64_t address = bindAddrIn->sin_addr.s_addr;

hash = static_cast<uint64_t>(minPort) << 48;
hash = static_cast<uint64_t>(maxPort) << 32;
hash |= static_cast<uint64_t>(minPort) << 48;
hash |= static_cast<uint64_t>(maxPort) << 32;
hash |= (address >> 2) << 2;
hash |= 0x0000; // AF_INET.

Expand All @@ -693,8 +693,8 @@ namespace RTC

const auto address = a[0] ^ a[1] ^ a[2] ^ a[3];

hash = static_cast<uint64_t>(minPort) << 48;
hash = static_cast<uint64_t>(maxPort) << 32;
hash |= static_cast<uint64_t>(minPort) << 48;
hash |= static_cast<uint64_t>(maxPort) << 32;
hash |= static_cast<uint64_t>(address) << 16;
hash |= (static_cast<uint64_t>(address) >> 2) << 2;
hash |= 0x0002; // AF_INET6.
Expand Down

0 comments on commit b70fe72

Please sign in to comment.