Skip to content

Commit 25a2b3b

Browse files
ThisSeanZhangdanielocfb
authored andcommitted
example: Add TCP header modification example
- add example to workspace - exit program when attach fails
1 parent 287c22b commit 25a2b3b

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

Cargo.lock

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ members = [
88
"examples/runqslower",
99
"examples/tc_port_whitelist",
1010
"examples/tcp_ca",
11+
"examples/tcp_option",
1112
"examples/tproxy",
1213
]
1314
resolver = "2"

examples/tcp_option/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ fn main() -> Result<()> {
136136
println!("BPF Attached Successfully!");
137137
}
138138
_ => {
139-
println!("Failed to Attach BPF, Reason: {:?}", Error::last_os_error());
139+
println!("Failed to Attach BPF, Reason: ");
140+
return Err(Error::last_os_error().into());
140141
}
141142
};
142143

0 commit comments

Comments
 (0)