[VOL-3776] Wrong openflow error message caused disconnection from controller, thus miss removal of data for subscribers
Change-Id: I680a5a0121d70f13cb98468279ca2cad404edfa1
diff --git a/VERSION b/VERSION
index 26ca594..4bb2004 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.5.1
+1.5.2-dev
diff --git a/internal/pkg/ofagent/changeEvent.go b/internal/pkg/ofagent/changeEvent.go
index f65c6d9..845db8a 100644
--- a/internal/pkg/ofagent/changeEvent.go
+++ b/internal/pkg/ofagent/changeEvent.go
@@ -90,16 +90,14 @@
ofErrMsg := ofp.NewFlowModFailedErrorMsg()
ofErrMsg.SetXid(header.Xid)
+ ofErrMsg.SetCode(ofp.FlowModFailedCode(errMsg.Code))
+
if header.Version != 0 {
ofErrMsg.SetVersion(uint8(header.Version))
} else {
ofErrMsg.SetVersion(4)
}
-
- ofErrMsg.SetType(uint8(errMsg.Header.Type))
- ofErrMsg.SetCode(ofp.FlowModFailedCode(errMsg.Code))
ofErrMsg.SetData(errMsg.Data)
-
if err := ofa.getOFClient(ctx, deviceID).SendMessage(ctx, ofErrMsg); err != nil {
logger.Errorw(ctx, "handle-change-events-send-message", log.Fields{"error": err})
}