aboutsummaryrefslogtreecommitdiffstats
path: root/src/platform/linux/tun.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/linux/tun.rs')
-rw-r--r--src/platform/linux/tun.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/platform/linux/tun.rs b/src/platform/linux/tun.rs
index 604fad9..82eb469 100644
--- a/src/platform/linux/tun.rs
+++ b/src/platform/linux/tun.rs
@@ -87,10 +87,12 @@ impl Reader for LinuxTunReader {
type Error = LinuxTunError;
fn read(&self, buf: &mut [u8], offset: usize) -> Result<usize, Self::Error> {
+ /*
debug_assert!(
offset < buf.len(),
"There is no space for the body of the read"
);
+ */
let n: isize =
unsafe { read(self.fd, buf[offset..].as_mut_ptr() as _, buf.len() - offset) };
if n < 0 {
@@ -132,10 +134,11 @@ impl Tun for LinuxTun {
type Error = LinuxTunError;
type Reader = LinuxTunReader;
type Writer = LinuxTunWriter;
- type Status = LinuxTunStatus;
}
impl PlatformTun for LinuxTun {
+ type Status = LinuxTunStatus;
+
fn create(name: &str) -> Result<(Vec<Self::Reader>, Self::Writer, Self::Status), Self::Error> {
// construct request struct
let mut req = Ifreq {