commit | 79cbd1caf6bd596edfe91379704ba8080680b114 | [log] [tgz] |
---|---|---|
author | Yuta HIGUCHI <y-higuchi@onlab.us> | Thu Oct 02 16:57:57 2014 -0700 |
committer | Yuta HIGUCHI <y-higuchi@onlab.us> | Thu Oct 02 17:02:43 2014 -0700 |
tree | 0ba3912096ea07a993b16bf7b05c097f808cdf77 | |
parent | 707a7e62f2bb161f8af280c0119b00cc6c73c4dd [diff] |
Ignore setRole if switch is not connected to that node. Change-Id: I40fb0b768294926924b29c7715a91c95df9b9664
diff --git a/openflow/ctl/src/main/java/org/onlab/onos/openflow/controller/impl/OpenFlowControllerImpl.java b/openflow/ctl/src/main/java/org/onlab/onos/openflow/controller/impl/OpenFlowControllerImpl.java index eb12286..e8ebcd1 100644 --- a/openflow/ctl/src/main/java/org/onlab/onos/openflow/controller/impl/OpenFlowControllerImpl.java +++ b/openflow/ctl/src/main/java/org/onlab/onos/openflow/controller/impl/OpenFlowControllerImpl.java
@@ -169,7 +169,12 @@ @Override public void setRole(Dpid dpid, RoleState role) { - getSwitch(dpid).setRole(role); + final OpenFlowSwitch sw = getSwitch(dpid); + if (sw == null) { + log.debug("Switch not connected. Ignoring setRole({}, {})", dpid, role); + return; + } + sw.setRole(role); } /**