tun2proxy / wintun-bindings

Safe rust idiomatic bindings for the Wintun library
https://crates.io/crates/wintun-bindings
MIT License
4 stars 2 forks source link

Wintun adapter does not specify as thread-safe #4

Open vnt-dev opened 3 weeks ago

vnt-dev commented 3 weeks ago
pub struct Adapter {
    adapter: UnsafeHandle<wintun_raw::WINTUN_ADAPTER_HANDLE>,
    pub(crate) wintun: Wintun,
    guid: u128,
    index: u32,
    luid: NET_LUID_LH,
}

fn create(..)->Arc<Adapter>
/// undefined behavior
fn start_session(self: &Arc<Self>)->Arc<Session>
ssrlive commented 3 weeks ago

How crazy a user must be to think of frequently creating and destroying sessions. If I remember correctly, this adapter is designed to serve one session. If you want to create another session, something may go wrong. You can Check it in the source code or try to fix it.