puppetlabs / puppetlabs/puppetlabs-stdlib
`Stdlib::Port` should (probably) not allow 0
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 349
- Forks
- 573
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 1
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the README description of Stdlib::Port, then locate the Stdlib::Port definition and any derived types. Determine whether the project should document port 0 as valid or change the lower bound to 1, including derived types, and verify the chosen behavior with the existing project checks.
Written by the indexing model from the issue text.
Assessment
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100