Skip to content

Commit

Permalink
Merge pull request #11 from xmh0511/v2
Browse files Browse the repository at this point in the history
avoid unnecessary copy and fix lfreq not found on macOS
  • Loading branch information
xmh0511 authored Jan 22, 2024
2 parents 4b48324 + e0e0792 commit a891bd9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ keywords = ["tun", "network", "tunnel", "bindings"]
byteorder = { version = "1" }
bytes = { version = "1" }
futures-core = { version = "0.3", optional = true }
libc = "0.2"
libc = "0.2.152"
log = "0.4"
thiserror = "1"
tokio = { version = "1", features = ["net", "macros"], optional = true }
Expand Down
2 changes: 1 addition & 1 deletion src/platform/android/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl Device {
/// Split the interface into a `Reader` and `Writer`.
pub fn split(self) -> (posix::Reader, posix::Writer) {
let fd = Arc::new(self.queue.tun);
(posix::Reader(fd.clone()), posix::Writer(fd.clone()))
(posix::Reader(fd.clone()), posix::Writer(fd))
}

/// Return whether the device has packet information
Expand Down
2 changes: 1 addition & 1 deletion src/platform/ios/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Device {
/// Split the interface into a `Reader` and `Writer`.
pub fn split(self) -> (posix::Reader, posix::Writer) {
let fd = Arc::new(self.queue.tun);
(posix::Reader(fd.clone()), posix::Writer(fd.clone()))
(posix::Reader(fd.clone()), posix::Writer(fd))
}

/// Return whether the device has packet information
Expand Down
2 changes: 1 addition & 1 deletion src/platform/linux/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl Device {
/// Split the interface into a `Reader` and `Writer`.
pub fn split(mut self) -> (posix::Reader, posix::Writer) {
let fd = Arc::new(self.queues.swap_remove(0).tun);
(posix::Reader(fd.clone()), posix::Writer(fd.clone()))
(posix::Reader(fd.clone()), posix::Writer(fd))
}

/// Set non-blocking mode
Expand Down

0 comments on commit a891bd9

Please sign in to comment.