Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Dec 27, 2024
1 parent a6c22ef commit 2241d7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,6 @@ async fn setup(fd: i32) {
rt.block_on(async {
let mut cfg = tun::Configuration::default();
cfg.raw_fd(fd);
#[cfg(target_os = "ios")]
cfg.platform_config(|p_cfg| {
p_cfg.packet_information(true);
});
let mut tun = tun::create_as_async(&cfg).unwrap();
let mut framed = tun.into_framed();
while let Some(packet) = framed.next().await {
Expand Down
5 changes: 4 additions & 1 deletion src/platform/windows/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ impl Device {
let guid = config.platform_config.device_guid;
let adapter = match Adapter::open(&wintun, tun_name) {
Ok(a) => a,
Err(_) => Adapter::create(&wintun, tun_name, tun_name, guid)?,
Err(e) => {
log::debug!("failed to open adapter: {}", e);
Adapter::create(&wintun, tun_name, tun_name, guid)?
}
};
if let Some(metric) = config.metric {
// command: netsh interface ip set interface {index} metric={metric}
Expand Down

0 comments on commit 2241d7c

Please sign in to comment.