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 reject action work in AntreaIPAM mode #3003
Conversation
|
/test-flexible-ipam-e2e |
Codecov Report
@@ Coverage Diff @@
## main #3003 +/- ##
==========================================
- Coverage 60.61% 59.78% -0.83%
==========================================
Files 292 292
Lines 24708 24709 +1
==========================================
- Hits 14976 14772 -204
- Misses 8092 8317 +225
+ Partials 1640 1620 -20
Flags with carried forward coverage won't be shown. Click here to find out more.
|
6e4928b
to
ec0ec4f
Compare
|
/test-flexible-ipam-e2e |
ec0ec4f
to
1dd87fe
Compare
|
/test-flexible-ipam-e2e |
1dd87fe
to
89909f3
Compare
|
/test-flexible-ipam-e2e |
Signed-off-by: wgrayson <wgrayson@vmware.com>
ddc3989
to
04a3614
Compare
|
/test-e2e |
|
/test-integration |
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
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
|
/skip-conformance |
|
@GraysonWu "Fixes issue #xxx" won't close the issue automatically, please just write "Fixes #xxx" next time. |
Got it. Thanks for reminding me. |
Fixes issue #2979.
For this issue, after investigation, I noticed that only intra-Node Pod-to-Pod traffic with ingress reject policy will fail.
The root cause of this issue is that in AntreaIPAM mode, MAC addresses will always be re-written as
srcMAC=localGatewayMAC, dstMAC=dstPodInterfaceMACin L3ForwardingTable. https://github.com/antrea-io/antrea/blob/main/pkg/agent/openflow/pipeline.go#L1150-L1152.Previous reject logic for intra-Node Pod-to-Pod case is that directly output the reject response to the OF port of the dstPod of the reject response. This could work for egress policies because the packet hasn't reached L3ForwardingTable. But for ingress policies, MAC addresses haven't re-written. The generated reject response will use localGatewayMAC as dstMAC. When the client receives this response, it won't treat it as a correct response to its request.
This PR changed the reject logic for Pod-to-Pod intra-Node case to resubmit the packet to L3ForwardingTable instead of directly output to an OF port. So in AntreaIPAM mode, L3ForwardingTable could re-write MAC addresses to a correct state. And it also can work when not in AntreaIPAM mode.