Skip to content
Snippets Groups Projects
Commit 69ca41a9 authored by abat's avatar abat
Browse files

Merge into master from pull request #217:

Remove dead code and fix a bug in flowToDevice conversion (https://github.com/floodlight/floodlight/pull/217)
parents 0e4bd761 467a5e13
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
......
......@@ -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
......
......@@ -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
......
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