Skip to content

Commit

Permalink
Use LOCAL instead of CONTROLLER as the in_port of packet-out message (#…
Browse files Browse the repository at this point in the history
…4992)

CONTROLLER cannot be used as the in_port due to a bug in Windows ovsext
driver, otherwise the Windows OS would crash.

See openvswitch/ovs-issues#280.

Signed-off-by: Quan Tian <qtian@vmware.com>
  • Loading branch information
tnqn authored May 18, 2023
1 parent 4f279b4 commit 8ab9b2f
Showing 1 changed file with 5 additions and 1 deletion.
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)
return openflow.SendRejectPacketOut(p.ofClient,
srcMAC,
dstMAC,
srcIP,
dstIP,
0,
inPort,
outPort,
isIPv6,
ethernetPkt,
Expand Down

0 comments on commit 8ab9b2f

Please sign in to comment.