-
Notifications
You must be signed in to change notification settings - Fork 373
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
Rewrite dst MAC with host gateway's MAC #213
Conversation
Thanks for your PR. The following commands are available:
|
/test-e2e |
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.
thanks for making this change Wenying
Action().Drop(). | ||
Done(), | ||
} | ||
return |
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.
is the return statement serving some purpose here?
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.
The return here is to return the flows
, it is to follow the style of named return values.
https://yourbasic.org/golang/named-return-values-parameters/
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.
Thanks, I didn't know the explicit return
statement was required
pkg/agent/openflow/pipeline.go
Outdated
// 3) Cache src MAC if traffic comes from the host gateway and rewrite the dst MAC on traffic replied from Pod to the | ||
// cached MAC. | ||
// 4) Drop all invalid traffic. | ||
// 1) commit new connections to ct if the packet is sent from non-gateway. |
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.
correct me if I'm wrong, but I think we commit all connections, not just the ones which come from the gateway. We have this flow:
table=31, priority=190,ct_state=+new+trk,ip actions=ct(commit,table=40,zone=65520)
and we use that for the policy tables
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.
Actually we commit all connections to ct. But the flow entry you mentioned will commit non-gateway connections. As for the connections from gateway, it should hit another flow table=31, priority=200,ct_state=+new+trk,ip,reg0=0x1/0xffff actions=ct(commit,table=40,zone=65520,exec(load:0x20->NXM_NX_CT_MARK[])
The second flow has a higher priority, so the packets sent from gateway interface would hit it firstly, and other non-gateway traffic would hit the flow you mentioned.
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 will update the comments and remove the "if" conditions.
Also, I'll take care of updating my documentation PR if this gets merged first: #206 |
Rewrite dst MAC with host gateway's MAC for the packets sent back from the Endpoint located on the same Node as the sender, and not use ct_label as the cache for dynamic learning.
/test-e2e |
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
Rewrite dst MAC with host gateway's MAC for the packets sent back from the
Endpoint located on the same Node as the sender, and not use ct_label as the
cache for dynamic learning.
Fixes #211