Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-3296

Ephemeral port number (port="0") should not be affected by port offset

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 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
    • Fix Version/s: 9.0.0.Beta3, 9.0.0.Final
    • Component/s: Server
    • Labels:
      None

      Description

      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.:

      Caused by: java.lang.IllegalArgumentException: port out of range:-100
      

      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-1a9ef995f085779b0598a1322551e580L114

      The original condition was also not really correct, since we allow negative and positive port offsets, the correct condition really is

      if (!isFixedPort && port != 0) {

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  rhusar Radoslav Husar
                  Reporter:
                  rhusar Radoslav Husar
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: