Skip to content

Richfr/ Add windowsAddress support to WslcCreateContainer() API#40037

Open
1wizkid wants to merge 18 commits intofeature/wsl-for-appsfrom
richfr/portmapping
Open

Richfr/ Add windowsAddress support to WslcCreateContainer() API#40037
1wizkid wants to merge 18 commits intofeature/wsl-for-appsfrom
richfr/portmapping

Conversation

@1wizkid
Copy link
Copy Markdown

@1wizkid 1wizkid commented Mar 30, 2026

Summary of the Pull Request

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copilot AI review requested due to automatic review settings March 30, 2026 16:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the WSLC Client SDK’s container port-mapping path to support custom host binding addresses (including IPv6) instead of always binding to 127.0.0.1, and relaxes/updates validation around the windowsAddress field.

Changes:

  • Convert windowsAddress (IPv4/IPv6) into a string binding address for WSLCPortMapping during container creation.
  • Add input validation for windowsAddress->ss_family in WslcSetContainerSettingsPortMappings.

Copilot AI review requested due to automatic review settings April 1, 2026 17:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.

Copilot AI review requested due to automatic review settings April 1, 2026 17:58
@1wizkid 1wizkid marked this pull request as ready for review April 1, 2026 18:00
@1wizkid 1wizkid requested a review from a team as a code owner April 1, 2026 18:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 6 comments.

@1wizkid 1wizkid enabled auto-merge (squash) April 1, 2026 18:27
Copy link
Copy Markdown
Member

@JohnMcPMS JohnMcPMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost certainly needs a test update to prevent a negative test from failing when it passes in an address. Not sure if we can expect IPv6 everywhere, but at least passing in 127.0.0.1 (or maybe IPv6 loopback works even if no external IPv6 address is available?).

[Edit: Search suggests that IPv6 loopback is always available if device supports IPv6.]

Copy link
Copy Markdown
Collaborator

@OneBlue OneBlue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a couple comments, I would also recommend:

  • Updating the pull request title
  • Adding test coverage for the binding address wiring (at least for localhost, since that's the only thing that the service supports today)

You'll probably have to update existing tests as well


default:
// Reject unsupported or malformed address families
THROW_HR(E_INVALIDARG);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I recommend THROW_HR_MSG() so we can log the address family we received to make debugging easier

else
{
// If no binding address is provided, default to wildcard.
convertedPort.Family = AF_UNSPEC;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this fail later if we leave AF_UNSPEC here ?

I would recommend either defaulting to localhost, or requiring the caller to pass in the binding address.

The later would be my preference, so that way there's no ambiguity

@benhillis
Copy link
Copy Markdown
Member

Hey @1wizkid 👋 — Following up on this PR. Currently the wslc tests are failing in CI, and there are 11 unresolved review threads with feedback from maintainers, including:

  • Missing test coverage
  • Dangling pointer concerns (flagged 4 times)
  • Wildcard port binding security concern
  • \E_UNEXPECTED\ error code usage
  • \AF_UNSPEC\ failure risk

Is this change still needed? The review feedback covers some important safety and design issues that should be addressed before this can move forward. Let us know if you need any help!

@1wizkid
Copy link
Copy Markdown
Author

1wizkid commented Apr 7, 2026 via email

Copilot AI review requested due to automatic review settings April 7, 2026 16:54
@1wizkid 1wizkid closed this Apr 7, 2026
auto-merge was automatically disabled April 7, 2026 16:54

Pull request was closed

@1wizkid 1wizkid force-pushed the richfr/portmapping branch from 7f1eca4 to 715ce52 Compare April 7, 2026 16:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@1wizkid 1wizkid reopened this Apr 7, 2026
Copilot AI review requested due to automatic review settings April 7, 2026 17:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

richfr added 2 commits April 7, 2026 10:55
…that convertedPorts must stay in same scope as containerOptions and moved the declaration to be with that var
Copilot AI review requested due to automatic review settings April 7, 2026 19:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 3 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings April 7, 2026 22:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@1wizkid
Copy link
Copy Markdown
Author

1wizkid commented Apr 8, 2026 via email

Copilot AI review requested due to automatic review settings April 8, 2026 02:28
@1wizkid 1wizkid changed the title Richfr/portmapping Richfr/ Add windowsAddress support to WslcCreateContainer() API Apr 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

6 participants