Let the host choose where a guest's listening sockets bind
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- backend, networking
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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?
- Lingua principale
- Rust
- Stelle
- 72
- Fork
- 14
- Merge medio
- 15h 29m
- PR unite (30g)
- 40
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hyperlight-dev/hyperlight-unikraft
-
dependencies
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hyperlight-dev/hyperlight-unikraft#136 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
ci/nightly
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
hyperlight-dev/hyperlight-unikraft#290 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
ci/nightly
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
hyperlight-dev/hyperlight-unikraft#288 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
ci/nightly
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
hyperlight-dev/hyperlight-unikraft#285 ·
I maintainer di solito rispondono entro 1 giorno
-
ci/nightly
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
hyperlight-dev/hyperlight-unikraft#262 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di hyperlight-dev/hyperlight-unikraft
Issue simili
-
bug P2: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
-
tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
vfarcic/dot-agent-deck#2512 ·
I maintainer di solito rispondono entro 1 giorno