Support multi-queue when using a provided TUN file descriptor

Aperta
#111 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, linux

Direzione di ricerca

Start by reading the TUN initialization path that handles Options.FileDescriptor and the openQueue() check that depends on multiQueue; the issue does not name specific files or tests. Trace how Options.MultiQueue is applied when sing-tun opens the device itself and how externally provided descriptors are attached. Done means additional queues can be opened for a multi-queue interface supplied through a file descriptor, while unsupported cases are handled safely.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I'm implementing a TUN backend using Linux NetworkManager's VPN plugin API.

NetworkManager can create and configure a TUN interface with multi-queue enabled. The VPN plugin can then open /dev/net/tun and attach to the existing interface using TUNSETIFF, passing the resulting file descriptor to sing-tun via Options.FileDescriptor.

However, sing-tun currently only initializes multiQueue when it opens the TUN device itself. When using Options.FileDescriptor, the multiQueue field remains disabled, regardless of Options.MultiQueue. SoopenQueue() refuses to create additional queues, even when the underlying TUN interface supports multi-queue.

Expected change:

When Options.FileDescriptor and Options.MultiQueue are both set, sing-tun should support opening additional queues on the existing TUN interface.

I understand that the existed behavior is to prevent using Android system Tun with multi queue invalidly. But this usage should be rejected in sing-box platform interface.

Ideally, it may detect or validate whether the interface supports multi-queue rather than assuming that externally provided file descriptors are always single-queue.

This would allow sing-tun to work with multi-queue TUN interfaces managed by NetworkManager or other external components.

Lingua principale
Go
Stelle
244
Fork
260
Merge medio
4g 21h
PR unite (30g)
5

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SagerNet/sing-tun

Tutte le issue di SagerNet/sing-tun

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.