VOL-4426 Change ControllerBound flow check to use OF controller port
Change-Id: I3b261fd023a77e511973d22b2eed0ec598aa0884
diff --git a/VERSION b/VERSION
index 024b4b9..2f2974f 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-7.0.6
+7.0.7
diff --git a/pkg/platform/platform.go b/pkg/platform/platform.go
index 688ccd8..0fe3956 100644
--- a/pkg/platform/platform.go
+++ b/pkg/platform/platform.go
@@ -100,8 +100,6 @@
TpRange = TpIDEnd - TpIDStart
)
-var controllerPorts = []uint32{0xfffd, 0x7ffffffd, 0xfffffffd}
-
//MkUniPortNum returns new UNIportNum based on intfID, inuID and uniID
func MkUniPortNum(ctx context.Context, intfID, onuID, uniID uint32) uint32 {
var limit = int(intfID)
@@ -195,22 +193,15 @@
//IsUpstream returns true for Upstream and false for downstream
func IsUpstream(outPort uint32) bool {
- for _, port := range controllerPorts {
- if port == outPort {
- return true
- }
+ if IsControllerBoundFlow(outPort) {
+ return true
}
return (outPort & (1 << nniUniDiffPos)) == (1 << nniUniDiffPos)
}
//IsControllerBoundFlow returns true/false
func IsControllerBoundFlow(outPort uint32) bool {
- for _, port := range controllerPorts {
- if port == outPort {
- return true
- }
- }
- return false
+ return outPort == uint32(ofp.OfpPortNo_OFPP_CONTROLLER)
}
//OnuIDFromUniPortNum returns onuId from give portNum information.
diff --git a/pkg/platform/platform_test.go b/pkg/platform/platform_test.go
index 71c864a..015a2d3 100644
--- a/pkg/platform/platform_test.go
+++ b/pkg/platform/platform_test.go
@@ -365,7 +365,7 @@
// TODO: Add test cases.
{"IsControllerBoundFlow-1", args{outPort: 2147483645}, true},
{"IsControllerBoundFlow-2", args{outPort: 2147483646}, false},
- {"IsControllerBoundFlow-3", args{outPort: 4294967293}, true},
+ {"IsControllerBoundFlow-3", args{outPort: 4294967293}, false},
{"IsControllerBoundFlow-4", args{outPort: 4294967294}, false},
{"IsControllerBoundFlow-5", args{outPort: 65539}, false},
{"IsControllerBoundFlow-6", args{outPort: 1000}, false},