Fix missing return under AbstractBestPathSelector 61/70361/4
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Thu, 5 Apr 2018 06:54:42 +0000 (08:54 +0200)
committerClaudio David Gasparini <claudio.gasparini@pantheon.tech>
Thu, 5 Apr 2018 12:34:50 +0000 (12:34 +0000)
Change-Id: I0156a2be5a7772ecdbd55de5f5308092656b38eb
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/add/AddPathSelector.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/base/BasePathSelector.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/spi/AbstractBestPathSelector.java

index a4ee38ce1d916a2932860b232f146007f25e6593..fa4fd2abf613fbaa833bed4a37bf243674f664b5 100644 (file)
@@ -13,6 +13,7 @@ import com.google.common.primitives.UnsignedInteger;
 import org.opendaylight.protocol.bgp.mode.api.BestPathState;
 import org.opendaylight.protocol.bgp.mode.impl.BestPathStateImpl;
 import org.opendaylight.protocol.bgp.mode.spi.AbstractBestPathSelector;
+import org.opendaylight.protocol.bgp.rib.spi.RouterIds;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -41,7 +42,7 @@ public final class AddPathSelector extends AbstractBestPathSelector {
              */
             final BestPathState state = new BestPathStateImpl(attrs);
             if (this.bestOriginatorId == null || !isExistingPathBetter(state)) {
-                LOG.trace("Selecting path from router {}", key);
+                LOG.trace("Selecting path from router {}", RouterIds.createPeerId(key.getRouteId()).getValue());
                 this.bestOriginatorId = originatorId;
                 this.bestState = state;
                 this.bestRouteKey = key;
index 9e209a0c66ec1c72c2445a2a08de2075e4cd750f..6dbff1e1f34714bcb01f1ebdd1b59bb96ece6cd7 100644 (file)
@@ -13,6 +13,7 @@ import com.google.common.primitives.UnsignedInteger;
 import org.opendaylight.protocol.bgp.mode.api.BestPathState;
 import org.opendaylight.protocol.bgp.mode.impl.BestPathStateImpl;
 import org.opendaylight.protocol.bgp.mode.spi.AbstractBestPathSelector;
+import org.opendaylight.protocol.bgp.rib.spi.RouterIds;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -38,7 +39,7 @@ final class BasePathSelector extends AbstractBestPathSelector {
              */
             final BestPathState state = new BestPathStateImpl(attrs);
             if (this.bestOriginatorId == null || !isExistingPathBetter(state)) {
-                LOG.trace("Selecting path from router {}", routerId);
+                LOG.trace("Selecting path from router {}", RouterIds.createPeerId(routerId).getValue());
                 this.bestOriginatorId = originatorId;
                 this.bestRouterId = routerId;
                 this.bestState = state;
index b5ca13826ec6d19dc0ec11d874eaf30bdaa5edd4..04ed6e682fc0132a84654f3995c3554b8e531887 100644 (file)
@@ -34,7 +34,7 @@ public class AbstractBestPathSelector {
      */
     protected UnsignedInteger replaceOriginator(final UnsignedInteger routerId, final OriginatorId originatorId) {
         if (originatorId != null) {
-            RouterIds.routerIdForAddress(originatorId.getOriginator().getValue());
+            return RouterIds.routerIdForAddress(originatorId.getOriginator().getValue());
         }
 
         return routerId;