Skip to content

Commit

Permalink
Reverse of sk_msg.
Browse files Browse the repository at this point in the history
  • Loading branch information
pdliyan committed Mar 23, 2024
1 parent 17fe98c commit 3bee1bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions {{project-name}}/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ async fn main() -> Result<(), anyhow::Error> {
program.load()?;
program.attach(cgroup)?;
{%- when "sk_msg" -%}
let prog: &mut SkMsg = bpf.program_mut("{{crate_name}}").unwrap().try_into()?;
prog.load()?;

let sock_map: SockHash::<_, SockKey> = bpf.map("{{sock_map}}").unwrap().try_into()?;
let map_fd = sock_map.fd();

let prog: &mut SkMsg = bpf.program_mut("{{crate_name}}").unwrap().try_into()?;
prog.load()?;
prog.attach(map_fd)?;
// insert sockets to the map using sock_map.insert here, or from a sock_ops program
{%- when "xdp" -%}
Expand Down

0 comments on commit 3bee1bc

Please sign in to comment.