BGPCEP-748: Fix AFI/SAFI 65/67465/3
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Tue, 23 Jan 2018 09:01:22 +0000 (10:01 +0100)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Tue, 23 Jan 2018 12:31:18 +0000 (13:31 +0100)
peer support registration when old-school BGP-4
is used.

Change-Id: I2137ea2647f01fb87bad04e682fe0bf5541768e8
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java

index 71b67bd32767e5db8672158071ef1ac19ca43cba..f709cbd1a679c7f664ebee1fc4ad3b705e2c29b4 100644 (file)
@@ -341,7 +341,7 @@ public class BGPPeer extends BGPPeerStateImpl implements BGPSessionListener, Pee
                         peerIId, this.peerRole, this.simpleRoutingPolicy));
             }
         }
-        addBgp4Support(peerId, announceNone);
+        addBgp4Support(peerId, peerIId, announceNone);
 
         if (!isLearnNone(this.simpleRoutingPolicy)) {
             this.effRibInWriter = EffectiveRibInWriter.create(this.rib.getService(),
@@ -367,10 +367,15 @@ public class BGPPeer extends BGPPeerStateImpl implements BGPSessionListener, Pee
     }
 
     //try to add a support for old-school BGP-4, if peer did not advertise IPv4-Unicast MP capability
-    private void addBgp4Support(final PeerId peerId, final boolean announceNone) {
+    private void addBgp4Support(final PeerId peerId, final YangInstanceIdentifier peerIId, final boolean announceNone) {
         final TablesKey key = new TablesKey(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class);
         if (this.tables.add(key) && !announceNone) {
             createAdjRibOutListener(peerId, key, false);
+            final ExportPolicyPeerTracker exportTracker = this.rib.getExportPolicyPeerTracker(key);
+            if (exportTracker != null) {
+                this.tableRegistration.add(exportTracker.registerPeer(peerId,  null, peerIId,
+                        this.peerRole, this.simpleRoutingPolicy));
+            }
         }
     }