Skip to content

Fix TCP port range validation - #4075

Open
ShiroKSH wants to merge 1 commit into
dstackai:masterfrom
ShiroKSH:fix/validate-tcp-port-range
Open

Fix TCP port range validation#4075
ShiroKSH wants to merge 1 commit into
dstackai:masterfrom
ShiroKSH:fix/validate-tcp-port-range

Conversation

@ShiroKSH

@ShiroKSH ShiroKSH commented Jul 30, 2026

Copy link
Copy Markdown

Summary

  • Reject port values above the TCP/UDP maximum of 65535.
  • Cover task port lists and service port parsing, including local and container mappings.

ValidPort previously accepted 65536, allowing an invalid port to reach job specifications.

Fixes #4076.

Tests

  • uv run pytest src/tests/_internal/pydantic_compat/test_field_parsing.py --pydantic-compat -q
  • uv run ruff check src/dstack/_internal/core/models/configurations.py src/tests/_internal/pydantic_compat/test_field_parsing.py
  • uv run ruff format --check src/dstack/_internal/core/models/configurations.py src/tests/_internal/pydantic_compat/test_field_parsing.py

@peterschmidt85

Copy link
Copy Markdown
Contributor

Any chance you first could submit an issue with steps to reproduce? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Port 65536 is accepted in run configurations

2 participants