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
[Bug Fix]Fix infinite rejection loop by adding ingress/egress bypass flows #2579
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2579 +/- ##
==========================================
+ Coverage 60.23% 60.38% +0.15%
==========================================
Files 282 282
Lines 22337 22403 +66
==========================================
+ Hits 13454 13529 +75
+ Misses 7459 7444 -15
- Partials 1424 1430 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, but DCO and commit message is missing
d182f6b
to
b6deaee
Compare
|
Added. |
|
/test-all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM, nit in the PR description: let's mention the TCP reject response will also hit ct_state -new+rel?
@Dyanngg For TCP, it will hit the flow with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why these flows are added by the establishedConnectionFlows function. A related connection is not an established connection, and the flow used to match reject traffic injected by the agent has nothing to do with established connections either?
b6deaee
to
18fa65f
Compare
Add two bypass flows in all egress tables(45,50,60) and ingress tables(85,90,100). The bypass flow matching `ct_state=-new+rel` is used to bypass ICMP reply packets. The bypass flow matching `reg0=0x2000000/0x7000000` is used to bypass reject responses generated by the controller. Signed-off-by: wgrayson <wgrayson@vmware.com>
18fa65f
to
7f9d488
Compare
|
Good one. I separated them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, will wait for @tnqn to approve
|
/test-all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
I edited the commit message when merging it. It would be better to wrap the message to ~76 characters per line in the original commit in the future. |
Add two bypass flows in all egress tables(45,50,60) and ingress tables (85,90,100): - The bypass flow matching `ct_state=-new+rel` is used to bypass ICMP reply packets. - The bypass flow matching `reg0=0x2000000/0x7000000` is used to bypass reject responses generated by the controller. Signed-off-by: wgrayson <wgrayson@vmware.com>
This PR fixes issue #2548
This PR added some bypass flows in the ingress and egress table to make sure reject responses won't be enforced by network policies.
Why we need it
Previously, reject responses are controlled by network policies, which means that reject responses could also be rejected. It may cause an infinite loop of rejecting reject responses in the OVS pipeline.
Instead of
Rejectreject response, now we choose toAllowthe reject responses.Added Flows
Example
Suppose we have:
When PodA tries to talk to PodB using UDP, the process will be:
-new+rel.If in the beginning, PodA uses TCP to talk to PodB, then in step 4 above a TCP RST whose ct_state is
-new+estwill be received. And the bypass flow forct_state=-new+esthas already existed, so we don't need to handle it in this PR.