From 4d75bfbebc2c5addf1be8f04027a07f14ca853cd Mon Sep 17 00:00:00 2001 From: Jan Srnicek Date: Wed, 11 Oct 2017 11:38:06 +0200 Subject: HC2VPP-245 - Local mapping vs Locator set ordering LocalMapping must be writen after/deleted before Locator set, as it has reference to it Change-Id: I8a7299d25e0fb5c2ffb83a34f478d82b2edfa749 Signed-off-by: Jan Srnicek --- .../lisp/translate/write/factory/EidTableWriterFactory.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/factory/EidTableWriterFactory.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/factory/EidTableWriterFactory.java index 1e0758eec..9be3b60ea 100755 --- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/factory/EidTableWriterFactory.java +++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/factory/EidTableWriterFactory.java @@ -16,6 +16,8 @@ package io.fd.hc2vpp.lisp.translate.write.factory; +import static io.fd.hc2vpp.lisp.translate.write.factory.LocatorSetWriterFactory.LOCATOR_SET_ID; + import com.google.common.collect.ImmutableSet; import io.fd.hc2vpp.lisp.translate.AbstractLispInfraFactoryBase; import io.fd.hc2vpp.lisp.translate.write.AdjacencyCustomizer; @@ -84,15 +86,16 @@ public final class EidTableWriterFactory extends AbstractLispInfraFactoryBase im private void addLocalMappingSubtree(final ModifiableWriterRegistryBuilder registry) { final InstanceIdentifier localMappingSubtreeId = InstanceIdentifier.create(LocalMapping.class); + // LocalMapping must be writen after/deleted before Locator set, as it has reference to it final ImmutableSet> localMappingHandledChildren = ImmutableSet.of(localMappingSubtreeId.child(Eid.class), localMappingSubtreeId.child(HmacKey.class)); - registry.subtreeAdd(localMappingHandledChildren, + registry.subtreeAddAfter(localMappingHandledChildren, new GenericListWriter<>(VRF_SUBTABLE_ID.child(LocalMappings.class).child(LocalMapping.class), - new LocalMappingCustomizer(vppApi, localMappingContext))); + new LocalMappingCustomizer(vppApi, localMappingContext)), LOCATOR_SET_ID); - registry.subtreeAdd(localMappingHandledChildren, + registry.subtreeAddAfter(localMappingHandledChildren, new GenericListWriter<>(BRIDGE_DOMAIN_SUBTABLE_ID.child(LocalMappings.class).child(LocalMapping.class), - new LocalMappingCustomizer(vppApi, localMappingContext))); + new LocalMappingCustomizer(vppApi, localMappingContext)), LOCATOR_SET_ID); } /** -- cgit 1.2.3-korg