Reuse attributes after apply import policy
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / EffectiveRibInWriter.java
index 1b46203fdf61e87f1e85d3641d727bf1fc0c31c8..4b0bde1fdb1629d9a461a2c78d9406da5cb6ae1b 100644 (file)
@@ -395,8 +395,11 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
                 CountersUtil.increment(this.prefixesInstalled.get(tablesKey), tablesKey);
 
                 final YangInstanceIdentifier attPath = routePath.node(ribSupport.routeAttributesIdentifier());
-                final ContainerNode finalAttribute = ribSupport.attributeToContainerNode(attPath, optEffAtt.get());
-                tx.put(LogicalDatastoreType.OPERATIONAL, attPath, finalAttribute);
+                final Attributes attToStore = optEffAtt.get();
+                if(!attToStore.equals(routeAttrs)) {
+                    final ContainerNode finalAttribute = ribSupport.attributeToContainerNode(attPath, attToStore);
+                    tx.put(LogicalDatastoreType.OPERATIONAL, attPath, finalAttribute);
+                }
                 break;
             default:
                 LOG.warn("Ignoring unhandled route {}", route);