X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsamples%2Fsimpleforwarding%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsamples%2Fsimpleforwarding%2Finternal%2FSimpleForwardingImpl.java;h=94e67247c8eaa44696f83d2950bea6650732f89a;hb=40b7bf5aaa289756525a775bf63b3783a914ed38;hp=b9d8fee986131328ea00be70394eb66f61b246ce;hpb=d5759c52d69ba8725d9bbdc18e81848f319861d1;p=controller.git diff --git a/opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/SimpleForwardingImpl.java b/opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/SimpleForwardingImpl.java index b9d8fee986..94e67247c8 100644 --- a/opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/SimpleForwardingImpl.java +++ b/opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/SimpleForwardingImpl.java @@ -999,17 +999,21 @@ public class SimpleForwardingImpl implements IfNewHostNotify, return; } HostNodeConnector destHost = hostTracker.hostFind(dIP); + /* + * In cases when incoming and outgoing connectors are in the same node, there is no need + * to verify that there is a route. Because of that, we will only need routing.getRoute() + * if we know that src and dst nodes are different. + */ if (destHost != null - && (routing == null || + && (incomingNodeConnector.getNode().equals(destHost.getnodeconnectorNode()) || + routing == null || routing.getRoute(incomingNodeConnector.getNode(), destHost.getnodeconnectorNode()) != null)) { log.trace("Host {} is at {}", dIP, destHost.getnodeConnector()); - HostNodePair key = new HostNodePair(destHost, incomingNodeConnector.getNode()); // If SimpleForwarding is aware of this host, it will try to install // a path. Forward packet until it's done. - if (dataPacketService != null && this.rulesDB.containsKey(key)) { - + if (dataPacketService != null) { /* * if we know where the host is and there's a path from where this