From 3a57bdf066f01e118dd13d5bdeb166af55f79d24 Mon Sep 17 00:00:00 2001 From: "Claudio D. Gasparini" Date: Sat, 12 Jan 2019 00:39:48 +0100 Subject: [PATCH] Reuse attributes after apply import policy Update attributes only if there has been any change applied by import policy. Otherwise attibutes are the same for the route that has been already stored. Change-Id: I288cea16badcd81ce4d5aef21214394421bb992c Signed-off-by: Claudio D. Gasparini --- .../protocol/bgp/rib/impl/EffectiveRibInWriter.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java index 1b46203fdf..4b0bde1fdb 100644 --- a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java +++ b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java @@ -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); -- 2.36.6