Skip to content

Commit 6226047

Browse files
hsqStephenZhangcavivie
authored andcommitted
fix: fix arg in forward example
1 parent 3a7e0b9 commit 6226047

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/forward.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ struct Opt {
4040
#[structopt(short = "i", long = "interface")]
4141
interface: String,
4242

43+
/// name of the tun device, default to rtun8.
44+
#[structopt(short = "n", long = "name", default_value = "utun8")]
45+
name: String,
46+
4347
/// Tracing subscriber log level.
4448
#[structopt(long = "log-level", default_value = "debug")]
4549
log_level: tracing::Level,
@@ -92,7 +96,7 @@ async fn main_exec(opt: Opt) {
9296
if fd >= 0 {
9397
cfg.raw_fd(fd);
9498
} else {
95-
cfg.tun_name(&opt.interface)
99+
cfg.tun_name(&opt.name)
96100
.address("10.10.10.2")
97101
.destination("10.10.10.1")
98102
.mtu(tun2::DEFAULT_MTU);

0 commit comments

Comments
 (0)