Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libbpf: Added AttachXDP wrapper #170

Merged
merged 7 commits into from Jun 14, 2022
Merged

Conversation

guyarb
Copy link
Contributor

@guyarb guyarb commented Jun 8, 2022

@guyarb guyarb mentioned this pull request Jun 8, 2022
@grantseltzer
Copy link
Contributor

Hi @guyarb! My apologies for the delay in review, I was off all of last week. I'll be looking at this today.

libbpfgo.go Outdated Show resolved Hide resolved
libbpfgo.go Outdated
bpfLink := &BPFLink{
link: link,
prog: p,
linkType: Tracepoint,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure that this is the correct link type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great catch! Added new link type XDP

@grantseltzer
Copy link
Contributor

I manually tested this and of course it works great, thanks for submitting! Just a comment and a question. I'd like to have a selftest for this but because it'll require an external program it can get complicated, not going to ask that of you.

guyarb and others added 3 commits June 14, 2022 07:36
Co-authored-by: grantseltzer <grantseltzer@gmail.com>
Changed the linkType field in the XDP BPFLink to XDP
@guyarb
Copy link
Contributor Author

guyarb commented Jun 14, 2022

I manually tested this and of course it works great, thanks for submitting! Just a comment and a question. I'd like to have a selftest for this but because it'll require an external program it can get complicated, not going to ask that of you.

I copied the selftest from tc and modified it accordingly
Ran it locally and it worked
If I made anything wrong in the selftest - please let me know!

selftest/xdp/main.go Outdated Show resolved Hide resolved
selftest/xdp/main.bpf.c Outdated Show resolved Hide resolved
@grantseltzer grantseltzer merged commit beff12a into aquasecurity:main Jun 14, 2022
@grantseltzer
Copy link
Contributor

Thank you @guyarb !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants