You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ZS_LOG_WARNING(Debug, log("will not attempt to rebind to default port") + ZS_PARAM("ip address", ioBindIP.string()))
4929
4953
}
4954
+
} elseif (!firstAttempt) {
4955
+
WORD selectedPort = mPortRestriction.getRandomPosition(IHelper::random(0, std::numeric_limits<size_t>::max()));
4956
+
ioBindIP.setPort(selectedPort);
4957
+
ZS_LOG_DEBUG(log("will attempt to bind to chosen port") + ZS_PARAM("ip address", ioBindIP.string()))
4930
4958
}
4931
4959
4932
4960
socket->bind(ioBindIP);
@@ -4946,6 +4974,10 @@ namespace ortc
4946
4974
WORD bindPort = local.getPort();
4947
4975
ioBindIP.setPort(bindPort);
4948
4976
if (0 == mDefaultPort) {
4977
+
if (!mPortRestriction.isAllowed(mDefaultPort)) {
4978
+
ZS_LOG_WARNING(Detail, log("OS selected a port that is within the denied ports allowed (will attempt rebind on random, non OS chosen, and non denied port)") + ZS_PARAM("port", bindPort));
4979
+
ZS_THROW_CUSTOM_PROPERTIES_1(Socket::Exceptions::Unspecified, 0, String("OS port selection was within denied port range: " + string(bindPort)));
0 commit comments