summaryrefslogtreecommitdiffstats
path: root/routing/routing-impl/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'routing/routing-impl/src/main')
-rw-r--r--routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/RoutingProtocolCustomizer.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/RoutingProtocolCustomizer.java b/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/RoutingProtocolCustomizer.java
index 220f07690..69b8e509e 100644
--- a/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/RoutingProtocolCustomizer.java
+++ b/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/RoutingProtocolCustomizer.java
@@ -61,9 +61,12 @@ public class RoutingProtocolCustomizer
// while using ip_add_del_table
routingProtocolContext.addName(tableId, newProtocolName, mappingContext);
} else {
- throw new IllegalStateException(String.format(
- "An attempt to assign protocol %s to table id %s. Table id already assigned to protocol %s",
- newProtocolName, tableId, routingProtocolContext.getName(tableId, mappingContext)));
+ // prevent to fail while restoring data(trying to remap already mapped name)
+ if (!newProtocolName.equals(routingProtocolContext.getName(tableId, mappingContext))) {
+ throw new IllegalStateException(String.format(
+ "An attempt to assign protocol %s to table id %s. Table id already assigned to protocol %s",
+ newProtocolName, tableId, routingProtocolContext.getName(tableId, mappingContext)));
+ }
}
}
}