Jian Li

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
......@@ -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);
}
}
}
......