Merge pull request #228 from nak3/fix-socket_filter

Fix socket_filter section match
pull/239/head
Alessandro Decina 3 years ago committed by GitHub
commit d690710337
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -186,7 +186,7 @@ impl FromStr for ProgramSection {
let name = section.splitn(2, '/').last().unwrap().to_owned(); let name = section.splitn(2, '/').last().unwrap().to_owned();
TracePoint { name } TracePoint { name }
} }
"socket_filter" => SocketFilter { name }, "socket" => SocketFilter { name },
"sk_msg" => SkMsg { name }, "sk_msg" => SkMsg { name },
"sk_skb" => match &*name { "sk_skb" => match &*name {
"stream_parser" => SkSkbStreamParser { name }, "stream_parser" => SkSkbStreamParser { name },
@ -1256,7 +1256,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, BpfSectionKind::Program,
"socket_filter/foo", "socket/foo",
bytes_of(&fake_ins()) bytes_of(&fake_ins())
)), )),
Ok(()) Ok(())

Loading…
Cancel
Save