From: Giovanni Meo Date: Tue, 22 Apr 2014 18:32:03 +0000 (+0000) Subject: Merge "Bug-590: Packet loss on first time ping test" X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~186 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=632b3b4a1c9477ca5c744e04021e4061e4d97130;hp=866769acecbabd1c8b24f3f3887349029454ba54 Merge "Bug-590: Packet loss on first time ping test" --- 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..d3cefd41b3 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,12 +999,18 @@ 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()); + HostNodePair key = new HostNodePair(destHost, destHost.getnodeconnectorNode()); // If SimpleForwarding is aware of this host, it will try to install // a path. Forward packet until it's done.