Skip to content

Commit

Permalink
Bump up libOpenflow and ofnet versions (#5160)
Browse files Browse the repository at this point in the history
This is to resolve an issue in packetIn2 which may lead to incorrect field
values in PackintIn2.Userdata and PacketIn2.Metadata. The issue is because the
existing code uses a pointer reference to set byte slice fields when
unmarshaling the mesages, and libOpenlow reuses the buffer to process the next
messages.

Signed-off-by: wenyingd <wenyingd@vmware.com>
  • Loading branch information
wenyingd authored Jun 26, 2023
1 parent 1948085 commit 7b1f364
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module antrea.io/antrea
go 1.19

require (
antrea.io/libOpenflow v0.10.2
antrea.io/ofnet v0.7.1
antrea.io/libOpenflow v0.10.3
antrea.io/ofnet v0.7.3
github.com/ClickHouse/clickhouse-go v1.5.4
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/Mellanox/sriovnet v1.1.0
Expand Down
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
antrea.io/libOpenflow v0.10.1/go.mod h1:drWN5iISj7G2J6MnclrFmgy0jHU1Z684WW0DxcrjNP0=
antrea.io/libOpenflow v0.10.2 h1:HsUHwFX//FsfCxHDf2R+IdmVf7NxVWO7nXYABDkszd4=
antrea.io/libOpenflow v0.10.2/go.mod h1:drWN5iISj7G2J6MnclrFmgy0jHU1Z684WW0DxcrjNP0=
antrea.io/ofnet v0.7.1 h1:9FgPTkxuf/DoJADYXLulwZztS+FYgUx3e4qI9hApx68=
antrea.io/ofnet v0.7.1/go.mod h1:DcRieON1uDeaFiSCZyD1f3Mi7q3nvycyJrt8xZAPP6s=
antrea.io/libOpenflow v0.10.3 h1:ZLqpwss8wqzLzRPXFV3/A2hDMpcfIPRCQKWebZ6oWRI=
antrea.io/libOpenflow v0.10.3/go.mod h1:drWN5iISj7G2J6MnclrFmgy0jHU1Z684WW0DxcrjNP0=
antrea.io/ofnet v0.7.3 h1:Ng0rqX2YW8Qp1x12PSwpIvpEA/WUBLB5sW48fJK3nfo=
antrea.io/ofnet v0.7.3/go.mod h1:HfBzG4jn8foWPRPuCk574qutPisf5EqAwYhvd4HrwF0=
bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/openflow/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ func newFakeClient(mockOFEntryOperations *oftest.MockOFEntryOperations,
client.generatePipelines()
client.realizePipelines()
binding.TableNameCache = getTableNameCache()
client.bridge.(*binding.OFBridge).SetOFSwitch(ofctrl.NewSwitch(&util.MessageStream{}, GlobalVirtualMAC, nil, make(chan int), 32776))
client.bridge.(*binding.OFBridge).SetOFSwitch(ofctrl.NewSwitch(&util.MessageStream{}, GlobalVirtualMAC, client.bridge.(ofctrl.AppInterface), make(chan int), 32776))
client.bridge.(*binding.OFBridge).Initialize()
return client
}
Expand Down
8 changes: 8 additions & 0 deletions pkg/ovs/openflow/ofctrl_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,14 @@ func (b *OFBridge) SwitchConnected(sw *ofctrl.OFSwitch) {
}()
}

func (b *OFBridge) FlowGraphEnabledOnSwitch() bool {
return true
}

func (b *OFBridge) TLVMapEnabledOnSwitch() bool {
return true
}

func (b *OFBridge) SetOFSwitch(sw *ofctrl.OFSwitch) {
b.ofSwitchMutex.Lock()
defer b.ofSwitchMutex.Unlock()
Expand Down

0 comments on commit 7b1f364

Please sign in to comment.