BUG-6427: Application peer doesnt announce routes II 49/44049/3
authorClaudio D. Gasparini <cgaspari@cisco.com>
Tue, 16 Aug 2016 09:33:55 +0000 (11:33 +0200)
committerMilos Fabian <milfabia@cisco.com>
Tue, 16 Aug 2016 18:04:13 +0000 (18:04 +0000)
Fix get Peer Destination role

Change-Id: If3f8a5e29105b36c793022aea0a7ed716d31f4b9
Signed-off-by: Claudio D. Gasparini <cgaspari@cisco.com>
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/add/AddPathAbstractRouteEntry.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/base/BaseAbstractRouteEntry.java

index 395811b2f7c041bd4094ab0ccbb3959498a642f8..1fa8d735973185d92d59c432bcab26ca7683689e 100644 (file)
@@ -169,16 +169,15 @@ public abstract class AddPathAbstractRouteEntry extends AbstractRouteEntry {
         for (final PeerRole role : PeerRole.values()) {
             final PeerExportGroup peerGroup = peerPT.getPeerGroup(role);
             if (peerGroup != null) {
-                final PeerRole destPeerRole = getRoutePeerIdRole(peerPT, routePeerId);
-                final ContainerNode effectiveAttributes = peerGroup.effectiveAttributes(destPeerRole, attributes);
+                final ContainerNode effectiveAttributes = peerGroup.effectiveAttributes(getRoutePeerIdRole(peerPT, routePeerId), attributes);
                 for (final Map.Entry<PeerId, PeerExporTuple> pid : peerGroup.getPeers()) {
                     final PeerId destPeer = pid.getKey();
                     final boolean destPeerSupAddPath = peerPT.isAddPathSupportedByPeer(destPeer);
-                    if (filterRoutes(routePeerId, destPeer, peerPT, localTK, discPeers, destPeerRole) && peersSupportsAddPathOrIsFirstBestPath(destPeerSupAddPath, isFirstBestPath)) {
+                    if (filterRoutes(routePeerId, destPeer, peerPT, localTK, discPeers, getRoutePeerIdRole(peerPT, destPeer))
+                        && peersSupportsAddPathOrIsFirstBestPath(destPeerSupAddPath, isFirstBestPath)) {
                         if (destPeerSupAddPath) {
                             update(destPeer, getAdjRibOutYII(ribSup, pid.getValue().getYii(), routeIdAddPath, localTK), effectiveAttributes,
-                                addPathValue,
-                                ribSup, tx);
+                                addPathValue, ribSup, tx);
                         } else {
                             update(destPeer, getAdjRibOutYII(ribSup, pid.getValue().getYii(), routeId, localTK), effectiveAttributes, value, ribSup, tx);
                         }
index aca064cb45d083bc9b799f075050b2b573823f98..7c2b8b8cc67b41efec6c044b88218395a97bc3c3 100644 (file)
@@ -181,10 +181,9 @@ abstract class BaseAbstractRouteEntry extends AbstractRouteEntry {
         for (final PeerRole role : PeerRole.values()) {
             final PeerExportGroup peerGroup = peerPT.getPeerGroup(role);
             if (peerGroup != null) {
-                final PeerRole destPeerRole = getRoutePeerIdRole(peerPT, routePeerId);
-                final ContainerNode effAttrib = peerGroup.effectiveAttributes(destPeerRole, attributes);
+                final ContainerNode effAttrib = peerGroup.effectiveAttributes(getRoutePeerIdRole(peerPT, routePeerId), attributes);
                 peerGroup.getPeers().stream()
-                    .filter(pid -> filterRoutes(routePeerId, pid.getKey(), peerPT, localTK, discPeers, destPeerRole))
+                    .filter(pid -> filterRoutes(routePeerId, pid.getKey(), peerPT, localTK, discPeers, getRoutePeerIdRole(peerPT, pid.getKey())))
                     .forEach(pid -> update(pid.getKey(), getAdjRibOutYII(ribSup, pid.getValue().getYii(), routeId, localTK), effAttrib, value, ribSup, tx));
             }
         }