Skip to content
Snippets Groups Projects
Commit a968cbb6 authored by Srinivasan Ramasubramanian's avatar Srinivasan Ramasubramanian
Browse files

[BSC-3362] If the flowModRemoved message from a switch has a reason that's...

[BSC-3362] If the flowModRemoved message from a switch has a reason that's beyond the limit, round it back to the maximum valid value.  This change will avoid creating a MessageParseException for invalid flowmod removal reasons.
parent a73afa78
No related branches found
No related tags found
No related merge requests found
......@@ -194,7 +194,11 @@ public class OFFlowRemoved extends OFMessage {
this.match.readFrom(data);
this.cookie = data.readLong();
this.priority = data.readShort();
this.reason = OFFlowRemovedReason.values()[(0xff & data.readByte())];
int reasonIndex = (int)(0xff & data.readByte());
if (reasonIndex >= OFFlowRemovedReason.values().length) {
reasonIndex = OFFlowRemovedReason.values().length - 1;
}
this.reason = OFFlowRemovedReason.values()[reasonIndex];
data.readByte(); // pad
this.durationSeconds = data.readInt();
this.durationNanoseconds = data.readInt();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment