aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/core/mapme.c
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-light/src/hicn/core/mapme.c')
-rw-r--r--hicn-light/src/hicn/core/mapme.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/hicn-light/src/hicn/core/mapme.c b/hicn-light/src/hicn/core/mapme.c
index 93a01bb0d..a22d01ae7 100644
--- a/hicn-light/src/hicn/core/mapme.c
+++ b/hicn-light/src/hicn/core/mapme.c
@@ -482,14 +482,6 @@ static bool mapme_hasLocalNextHops(const MapMe *mapme,
void
mapme_send_updates(const MapMe * mapme, FibEntry * fibEntry, const NumberSet * nexthops)
{
- /* Detect change */
- NumberSet * previous_nexthops = fibEntry_GetPreviousNextHops(fibEntry);
- if (numberSet_Equals(nexthops, previous_nexthops)) {
- INFO(mapme, "[MAP-Me] No change in nexthops");
- return;
- }
- fibEntry_SetPreviousNextHops(fibEntry, nexthops);
-
if (!TFIB(fibEntry)) /* Create TFIB associated to FIB entry */
mapme_CreateTFIB(fibEntry);
TFIB(fibEntry)->seq++;
@@ -507,6 +499,21 @@ mapme_send_updates(const MapMe * mapme, FibEntry * fibEntry, const NumberSet * n
free(name_str);
}
+
+void
+mapme_maybe_send_updates(const MapMe * mapme, FibEntry * fibEntry, const NumberSet * nexthops)
+{
+ /* Detect change */
+ NumberSet * previous_nexthops = fibEntry_GetPreviousNextHops(fibEntry);
+ if (numberSet_Equals(nexthops, previous_nexthops)) {
+ INFO(mapme, "[MAP-Me] No change in nexthops");
+ return;
+ }
+ fibEntry_SetPreviousNextHops(fibEntry, nexthops);
+
+ mapme_send_updates(mapme, fibEntry, nexthops);
+}
+
void
mapme_reconsiderFibEntry(const MapMe *mapme, FibEntry * fibEntry)
{