xchacha20-poly1305:请求 sing-tun 支持外部 TUN 描述符的多队列
xchacha20-poly1305 在实现 NetworkManager VPN 插件时指出,外部创建的 TUN 即使支持多队列,sing-tun 的 FileDescriptor 路径也未初始化 multiQueue,无法再开队列。作者请求同时设置 FileDescriptor、MultiQueue 时验证能力并支持多队列,并把 Android 不合法组合的限制放到平台接口;这是待实现请求。
作者原文@xchacha20-poly1305I'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/tunand attach to the existing interface usingTUNSETIFF, passing the resulting file descriptor to sing-tun viaOptions.FileDescriptor.However, sing-tun currently only initializes
multiQueuewhen it opens the TUN device itself. When usingOptions.FileDescriptor, themultiQueuefield remains disabled, regardless ofOptions.MultiQueue. SoopenQueue()refuses to create additional queues, even when the underlying TUN interface supports multi-queue.Expected change:
When
Options.FileDescriptorandOptions.MultiQueueare 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.