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

Use LOCAL instead of CONTROLLER as the in_port of packet-out message #4992

Merged
merged 1 commit into from
May 18, 2023
Merged
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
6 changes: 5 additions & 1 deletion pkg/agent/proxy/proxier.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"sync"
"time"

"antrea.io/libOpenflow/openflow15"
"antrea.io/libOpenflow/protocol"
"antrea.io/ofnet/ofctrl"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -1053,12 +1054,15 @@ func (p *proxier) HandlePacketIn(pktIn *ofctrl.PacketIn) error {
return fmt.Errorf("error when getting match field inPort")
}
outPort := inPortField.GetValue().(uint32)
// It cannot use CONTROLLER (the default value when inPort is 0) as the inPort due to a bug in Windows ovsext
// driver, otherwise the Windows OS would crash. See https://github.com/openvswitch/ovs-issues/issues/280.
inPort := uint32(openflow15.P_LOCAL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work with value "0xfffffffe" on Windows ? What about Linux?

Copy link
Member Author

@tnqn tnqn May 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have verified on Linux it works (accessig the service from antrea-gw0 and Pod interface), and @xliuxu tested manually on Windows via ovs-ofctl packet-out and it didn't crash. Will need your help to verify it end to end on Windows.

return openflow.SendRejectPacketOut(p.ofClient,
srcMAC,
dstMAC,
srcIP,
dstIP,
0,
inPort,
outPort,
isIPv6,
ethernetPkt,
Expand Down