-
Notifications
You must be signed in to change notification settings - Fork 444
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
Make sure compiler_meta__->drop starts out false #4722
Conversation
@komaljai please take another look when you have some time |
e10c514
to
0168e14
Compare
So, tested a bit more your suggestion, that is, initialising |
I was referring to struct pna_pre_input_metadata_t->pass field in pna.p4 file. This will give the current pass number and if it is pass 1, then we should initialize the compiler_meta__->drop value to false. |
I see, but if |
Looks fine |
This discussion on the customizations of pna.p4 flavors might be relevant. @jafingerhut Do you recall the reason why PreControl was removed? |
The reason that |
@vbnogueira Could you rebase the PR? |
Done |
We found scenarios where the skb->cb is not zeroed out before the bpf program is called. Since compiler_meta__ = skb->cb, there is an issue in some specific scenarios. For example, since the bpf code looks at compiler_meta__->drop to tell whether the packet should be dropped or not, if by any chance compiler_meta__->drop is initialised to true, the program will mistakenly drop the packet. To solve this, we are initialising compiler_meta__->drop to false before doing any processing on compiler_meta__->drop.
We found scenarios where the skb->cb is not zeroed out before the bpf
program is called. Since compiler_meta__ = skb->cb, there is an issue in
some specific scenarios. For example, since the bpf code looks at
compiler_meta__->drop to tell whether the packet should be dropped or not,
if by any chance compiler_meta__->drop is initialised to true, the
program will mistakenly drop the packet. To solve this, we are
initialising compiler_meta__->drop to false before doing any
processing on compiler_meta__->drop.