fw: Prevent re-insertion of faces into FaceTable
Change-Id: I48c92af965001e15af06b39de76893ce6a736b94
Refs: #1413
diff --git a/daemon/fw/face-table.cpp b/daemon/fw/face-table.cpp
index 35bf377..ca7b56f 100644
--- a/daemon/fw/face-table.cpp
+++ b/daemon/fw/face-table.cpp
@@ -25,6 +25,13 @@
void
FaceTable::add(shared_ptr<Face> face)
{
+ if (face->getId() != INVALID_FACEID &&
+ m_faces.count(face->getId()) > 0)
+ {
+ NFD_LOG_DEBUG("Trying to add existing face id=" << face->getId() << " to the face table");
+ return;
+ }
+
FaceId faceId = ++m_lastFaceId;
face->setId(faceId);
m_faces[faceId] = face;