bytedance / netcap

Apache License 2.0
639 stars 83 forks source link

bpf/skb: Fix netcap load fail in some kernel verison #10

Closed zf1575192187 closed 1 month ago

zf1575192187 commented 1 month ago

Error log: R2 unbounded memory access, use 'var &= const' or 'if (var < const)'.

The reason is that some variable types are inconsistent, and the min and max attribute is lost after type conversion, resulting bpf load failed.

wyEumenides commented 1 month ago

Thank you so much!

HaibaraAi119 commented 1 month ago

thanks, I've clone the latest source code,and then compiled and tested on centos 8(4.18.0-383.el8.x86_64 #1 SMP Wed Apr 20 15:38:08 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux),it's working,very good.