Bugfix: filter out msg type other than pkt-in, flow-mod, stat-rep

CPMan only deals with PACKET-IN, FLOW-MOD, STATS-REPLY types for
incoming control messages. With other message type, it throws
NPE. This commit tries to fix this problem.

Change-Id: Iedd264030e404b14d15e33907e082c3d73608baa
This commit is contained in:
Jian Li 2016-04-04 12:42:40 -07:00
parent 8b0ea969eb
commit 7ceb7b024a

View File

@ -38,6 +38,7 @@ import org.onosproject.openflow.controller.OpenFlowSwitchListener;
import org.onosproject.openflow.controller.RoleState;
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFPortStatus;
import org.projectfloodlight.openflow.protocol.OFType;
import org.slf4j.Logger;
import java.util.HashMap;
@ -205,7 +206,11 @@ public class OpenFlowControlMessageProvider extends AbstractProvider
@Override
public void handleMessage(Dpid dpid, OFMessage msg) {
aggregators.get(dpid).increment(msg);
if (msg.getType() == OFType.PACKET_IN ||
msg.getType() == OFType.FLOW_MOD ||
msg.getType() == OFType.STATS_REPLY) {
aggregators.get(dpid).increment(msg);
}
}
}