Let the host choose where a guest's listening sockets bind
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- rust
- 領域
- backend, networking
調査の方向性
Start by reading the SandboxBuilder, AppSandbox, socket bind/listen handling, and restore paths; the issue does not name specific files or tests. Work out how redirected host addresses should be reported and translated by net_getsockname, including port-zero binds and restored listeners. Done means the host can choose distinct listener addresses for each sandbox while guests see their requested addresses; the TCP-versus-listen decision and port-zero naming question need resolution first.
索引モデルが issue の本文から書いたものです。
説明
A guest's listening socket is a host socket, bound at exactly the address and port the guest asks for. For a host that runs many sandboxes in one process and puts its own front end in front of each, that causes four problems:
- A guest that binds
0.0.0.0, as most servers do, is reachable on every host interface, not only through the host's front end. - A restored guest re-binds the port it had at snapshot time. If another process or sandbox holds that port by then, the re-bind fails: the guest kernel logs
hostsock: cannot re-create a listening socket after restore, the listener is dead (acceptreturnsEIO, poll reports it hung up), andrestore()still returnsOk, so the host is not told. - Two sandboxes restored from one snapshot both try the same port, so only one of them can listen. If the guest set
SO_REUSEPORT, both bind, and the host kernel splits connections between them. - A guest that bound port 0 is silently given a different port on restore.
ListenPorts limits which ports a guest may bind, not where they are bound (#184 is related).
Proposal: a SandboxBuilder option that redirects listens. Whatever address and port a guest's listening socket asks for, the host socket is bound to an address the host chooses (for example 127.0.0.1:0), and AppSandbox reports the real address for each guest port, e.g. listen_addr(guest_port) -> Option<SocketAddr>. net_getsockname translates back to the guest's address, for listeners and the connections they accept. A restore re-establishes listeners through the same redirect, so each restored sandbox gets a port of its own.
Open questions:
- Bind comes before listen, so the host cannot yet tell a listener from a UDP server or a client choosing its source port. Should the redirect apply to TCP sockets only, or be decided at
listen? - How should
listen_addrname a guest listener that bound port 0?
- 主要言語
- Rust
- スター
- 72
- フォーク
- 14
- 平均マージ
- 15時間 29分
- マージ済み PR(30日)
- 40
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hyperlight-dev/hyperlight-unikraft のほかの issue
-
dependencies
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
hyperlight-dev/hyperlight-unikraft#136 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
ci/nightly
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
hyperlight-dev/hyperlight-unikraft#290 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
ci/nightly
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
hyperlight-dev/hyperlight-unikraft#288 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
ci/nightly
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
hyperlight-dev/hyperlight-unikraft#285 ·
メンテナーはふだん 1 日以内に返信
-
ci/nightly
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
hyperlight-dev/hyperlight-unikraft#262 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
hyperlight-dev/hyperlight-unikraft の issue をすべて見る
似ている issue
-
area:compat area:operations documentation ready-for-agent type:afk
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
ZcashFoundation/zinder#552 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
storytold/vectorcraft#9229 ·
メンテナーはふだん 1 日以内に返信