Skip to content

Stdlib::Port should (probably) not allow 0 #1394

Open
@Geod24

Description

@Geod24

Describe the Bug

README description of Stdlib::Port:
Matches a valid TCP/UDP Port number.
Port 0 is reserved for both TCP and UDP and most implementations will reject it. It is now used when binding to tell the kernel to find an available port. Hence, configurations that are pedantic will want to disable it to avoid misconfiguration.

Expected Behavior

Either the description should say "any TCP/UDP port" and there is a type to represent valid port numbers (Interger[1, 65535]) or the lower bound is changed from 0 to 1. The latter change should apply to any derived type too.

Additional Context

Technically (by the original RFC), port 0 was reserved, but the behavior it now has when calling bind makes allowing the value slightly dangerous: https://www.rfc-editor.org/rfc/rfc1340#page-7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions