]
Radoslav Husar reassigned WFCORE-3296:
--------------------------------------
Assignee: Radoslav Husar (was: Dmitrii Tikhomirov)
Ephemeral port number (port="0") should not be affected by
port offset
----------------------------------------------------------------------
Key: WFCORE-3296
URL:
https://issues.jboss.org/browse/WFCORE-3296
Project: WildFly Core
Issue Type: Bug
Affects Versions: 3.0.2.Final, 4.0.0.Final, 5.0.0.Final, 6.0.2.Final, 7.0.0.Final,
8.0.0.Final, 9.0.0.Beta2
Reporter: Radoslav Husar
Assignee: Radoslav Husar
Priority: Critical
Port 0 is almost universally considered a wildcard port/indeterminate port/ephemeral/port
chosen by the OS and obviously applying an offset to such port (e.g. offset of -100) will
fail on multiple fronts, e.g.:
{noformat}
Caused by: java.lang.IllegalArgumentException: port out of range:-100
{noformat}
This is a regression introduced in
https://issues.jboss.org/browse/WFLY-2345 based on
discussion on
https://developer.jboss.org/message/842406#842407 in PR
https://github.com/wildfly/wildfly/pull/5307/files#diff-1a9ef995f085779b0...
The original condition was also not really correct, since we allow negative and positive
port offsets, the correct condition really is {code}if (!isFixedPort && port != 0)
{{code}