diff --git a/src/main/java/net/floodlightcontroller/core/OFMessageFilterManager.java b/src/main/java/net/floodlightcontroller/core/OFMessageFilterManager.java index 5d9a38fc947bae9a079a64f11df579bbe2b652c0..777bfaf44d87997e9a4020f7beec87977e698620 100644 --- a/src/main/java/net/floodlightcontroller/core/OFMessageFilterManager.java +++ b/src/main/java/net/floodlightcontroller/core/OFMessageFilterManager.java @@ -423,11 +423,11 @@ public class OFMessageFilterManager packetClient.pushMessageAsync(sendMsg); } } catch (TTransportException e) { - log.error("Caught TTransportException: {}", e); + log.error("Caught TTransportException: {}", e.getMessage()); disconnectFromPSServer(); connectToPSServer(); } catch (Exception e) { - log.error("Caught exception: {}", e); + log.error("Caught exception: {}", e.getMessage()); disconnectFromPSServer(); connectToPSServer(); } diff --git a/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java b/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java index ba859bd9b13a525f8143d3627edc1e04b680d0fd..7246663a8318068064d0f180e4afb31faad91581 100755 --- a/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java +++ b/src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java @@ -858,11 +858,18 @@ IFlowReconcileListener, IInfoProvider, IHAListener { if ((dlAddrArr[0] & 0x1) != 0) return null; - long swDpid = ofmWithSwDpid.getSwitchDataPathId(); - short inPort = ofmWithSwDpid.getOfMatch().getInputPort(); + Long swDpid = null; + Short inPort = null; + + if (isSource) { + swDpid = ofmWithSwDpid.getSwitchDataPathId(); + inPort = ofmWithSwDpid.getOfMatch().getInputPort(); + } boolean learnap = true; - if (!isValidAttachmentPoint(swDpid, inPort)) { + if (swDpid == null || + inPort == null || + !isValidAttachmentPoint(swDpid, inPort)) { // If this is an internal port or we otherwise don't want // to learn on these ports. In the future, we should // handle this case by labeling flows with something that diff --git a/src/main/java/net/floodlightcontroller/routing/ForwardingBase.java b/src/main/java/net/floodlightcontroller/routing/ForwardingBase.java index a2eae4a43096dbbb083b3dab5be604ef058b8ced..445956a4d01cc8dd0bd40b1276f5275859f0c01d 100644 --- a/src/main/java/net/floodlightcontroller/routing/ForwardingBase.java +++ b/src/main/java/net/floodlightcontroller/routing/ForwardingBase.java @@ -47,11 +47,9 @@ import org.openflow.protocol.OFMatch; import org.openflow.protocol.OFMessage; import org.openflow.protocol.OFPacketIn; import org.openflow.protocol.OFPacketOut; -import org.openflow.protocol.OFPort; import org.openflow.protocol.OFType; import org.openflow.protocol.action.OFAction; import org.openflow.protocol.action.OFActionOutput; -import org.openflow.util.U16; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -534,29 +532,6 @@ public abstract class ForwardingBase implements @Override public void deviceMoved(IDevice device) { - // Build flow mod to delete based on destination mac == device mac - OFMatch match = new OFMatch(); - match.setDataLayerDestination(Ethernet.toByteArray(device.getMACAddress())); - match.setWildcards(OFMatch.OFPFW_ALL ^ OFMatch.OFPFW_DL_DST); - long cookie = - AppCookie.makeCookie(FORWARDING_APP_ID, 0); - OFMessage fm = ((OFFlowMod) floodlightProvider.getOFMessageFactory() - .getMessage(OFType.FLOW_MOD)) - .setCommand(OFFlowMod.OFPFC_DELETE) - .setOutPort((short) OFPort.OFPP_NONE.getValue()) - .setMatch(match) - .setCookie(cookie) - .setLength(U16.t(OFFlowMod.MINIMUM_LENGTH)); - - // Flush to all switches - for (IOFSwitch outSw : floodlightProvider.getSwitches().values()) { - try { - outSw.write(fm, null); - } catch (IOException e) { - log.error("Failure sending flow mod delete for moved device", - e); - } - } } @Override