Skip to content
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

[Windows] Set rewrite-MAC mark for NodePort Service packet #948

Merged
merged 1 commit into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkg/agent/openflow/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -968,12 +968,13 @@ func (c *client) bridgeAndUplinkFlows(uplinkOfport uint32, bridgeLocalPort uint3
Cookie(c.cookieAllocator.Request(category).Raw()).
Done(),
// Forward the packet to conntrackTable if it enters the OVS pipeline from the bridge interface and is sent to
// local Pods.
// local Pods. Set the packet with MAC rewrite mark, so that the dstMAC will be re-written with real MAC in
// the L3Routing table, and it could be forwarded to the valid OVS interface.
c.pipeline[ClassifierTable].BuildFlow(priorityHigh).
MatchProtocol(binding.ProtocolIP).
MatchInPort(bridgeLocalPort).
MatchDstIPNet(localSubnet).
Action().SetDstMAC(globalVirtualMAC).
wenyingd marked this conversation as resolved.
Show resolved Hide resolved
Action().LoadRegRange(int(marksReg), macRewriteMark, macRewriteMarkRange).
Action().GotoTable(conntrackTable).
Cookie(c.cookieAllocator.Request(category).Raw()).
Done(),
Expand Down
2 changes: 1 addition & 1 deletion test/integration/agent/openflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ func prepareExternalFlows(nodeIP net.IP, localSubnet *net.IPNet) []expectTableFl
},
{
fmt.Sprintf("priority=210,ip,in_port=LOCAL,nw_dst=%s", localSubnet.String()),
"set_field:aa:bb:cc:dd:ee:ff->eth_dst,goto_table:30",
"load:0x1->NXM_NX_REG0[19],goto_table:30",
},
},
},
Expand Down