VOL-2518 - reconnect to voltha on disconnect
Change-Id: Ia497bb6a83312f15e54de0d7556753e1d9ef58b0
diff --git a/internal/pkg/openflow/flowMod.go b/internal/pkg/openflow/flowMod.go
index 18390d1..4ab1afc 100644
--- a/internal/pkg/openflow/flowMod.go
+++ b/internal/pkg/openflow/flowMod.go
@@ -77,6 +77,12 @@
"params": js})
}
+ if ofc.VolthaClient == nil {
+ logger.Errorw("no-voltha-connection",
+ log.Fields{"device-id": ofc.DeviceID})
+ return
+ }
+
// Construct the match
var oxmList []*voltha.OfpOxmField
for _, oxmField := range flowAdd.Match.GetOxmList() {
@@ -257,6 +263,12 @@
"flow-delete-strict": js})
}
+ if ofc.VolthaClient == nil {
+ logger.Errorw("no-voltha-connection",
+ log.Fields{"device-id": ofc.DeviceID})
+ return
+ }
+
// Construct match
var oxmList []*voltha.OfpOxmField
for _, oxmField := range flowDeleteStrict.Match.GetOxmList() {