Skip to content

Commit

Permalink
fix: format IP address with {:i}
Browse files Browse the repository at this point in the history
`{:ipv4}` has been replaced with `{:i}` in aya-rs/aya#599.
  • Loading branch information
gingk1212 committed May 29, 2023
1 parent 4aa9a5b commit 3949c62
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/kprobetcp/kprobetcp-ebpf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn try_kprobetcp(ctx: ProbeContext) -> Result<u32, i64> {
});
info!(
&ctx,
"AF_INET src address: {:ipv4}, dest address: {:ipv4}",
"AF_INET src address: {:i}, dest address: {:i}",
src_addr,
dest_addr,
);
Expand Down
2 changes: 1 addition & 1 deletion examples/tc-egress/tc-egress-ebpf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn try_tc_egress(ctx: TcContext) -> Result<i32, ()> {
TC_ACT_PIPE
};

info!(&ctx, "DEST {:ipv4}, ACTION {}", destination, action);
info!(&ctx, "DEST {:i}, ACTION {}", destination, action);

Ok(action)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/xdp-drop/xdp-drop-ebpf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn try_xdp_firewall(ctx: XdpContext) -> Result<u32, ()> {
} else {
xdp_action::XDP_PASS
};
info!(&ctx, "SRC: {:ipv4}, ACTION: {}", source, action);
info!(&ctx, "SRC: {:i}, ACTION: {}", source, action);

Ok(action)
}
2 changes: 1 addition & 1 deletion examples/xdp-log/xdp-log-ebpf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn try_xdp_firewall(ctx: XdpContext) -> Result<u32, ()> {
// (3)
info!(
&ctx,
"SRC IP: {:ipv4}, SRC PORT: {}", source_addr, source_port
"SRC IP: {:i}, SRC PORT: {}", source_addr, source_port
);

Ok(xdp_action::XDP_PASS)
Expand Down

0 comments on commit 3949c62

Please sign in to comment.