mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-02 09:09:17 +00:00
feat: wire shared nic into instance setup
Route normal, DHCP, and mobile nic creation through one helper that selects the shared backend when dev_name is configured. Keep dedicated nic creation as the default for configs without a dev_name, and keep no_tun handling in the existing callers. Store a process-wide shared virtual nic registry behind each instance so networks with the same dev_name attach to the same shared device.
This commit is contained in:
@@ -121,6 +121,7 @@ impl EasyTierLauncher {
|
||||
let peer_mgr = instance.get_peer_manager();
|
||||
let nic_ctx = instance.get_nic_ctx();
|
||||
let peer_packet_receiver = instance.get_peer_packet_receiver();
|
||||
let shared_virtual_nic_registry = instance.get_shared_virtual_nic_registry();
|
||||
let mut tun_fd_receiver = data.tun_fd.1.lock().unwrap().take().unwrap();
|
||||
|
||||
tasks.spawn(async move {
|
||||
@@ -133,6 +134,7 @@ impl EasyTierLauncher {
|
||||
global_ctx.clone(),
|
||||
peer_mgr.clone(),
|
||||
peer_packet_receiver.clone(),
|
||||
shared_virtual_nic_registry.clone(),
|
||||
tun_fd,
|
||||
)
|
||||
.await;
|
||||
|
||||
Reference in New Issue
Block a user