Skip to content

Commit 703e0a3

Browse files
committed
pdate
1 parent 2b2e0d4 commit 703e0a3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

tun_test3/Cargo.lock

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tun_test3/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ edition = "2018"
77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
88

99
[dependencies]
10-
tokio-tun = "0.3.5"
10+
#tokio-tun = "0.3.5"
11+
tokio-tun = { git = "https://github.com/yaa110/tokio-tun.git" }
1112
tokio = { version = "1.1", features = ["net"] }
1213
libc = "0.2"
1314
nix = "0.19"

tun_test3/src/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ async fn main() -> Result<()> {
9595
println!("ping 10.1.0.2 to test");
9696
println!("---------------------");
9797

98-
let (mut reader, mut _writer) = tokio::io::split(tun);
98+
let (mut reader, mut writer) = tokio::io::split(tun);
9999

100100
let mut buf = [0u8; 1024];
101101
loop {
102102
let n = reader.read(&mut buf).await?;
103-
let r = _writer.write(&buf);
103+
let r = writer.write(&buf);
104104
//println!("{:?}",r);
105105

106106
//println!("reading {} bytes: {:?}", n, &buf[..n]);
@@ -125,7 +125,7 @@ async fn main() -> Result<()> {
125125
header. get_next_level_protocol(),
126126
//&buf[20..n],
127127
&buf[hlen..n],
128-
&mut _writer,
128+
&mut writer,
129129
);
130130

131131
//if let Some(header) = header {

0 commit comments

Comments
 (0)