rib: Fix to correctly set default expiration for self-registrations

Change-Id: I598fc8b0395118156fe2f394798b9ee846348c4f
Refs: #1772
diff --git a/rib/rib-manager.cpp b/rib/rib-manager.cpp
index c8d6111..fa26b8e 100644
--- a/rib/rib-manager.cpp
+++ b/rib/rib-manager.cpp
@@ -191,11 +191,6 @@
           return;
         }
 
-      if (!parameters.hasFaceId() || parameters.getFaceId() == 0)
-        {
-          parameters.setFaceId(request->getIncomingFaceId());
-        }
-
       NFD_LOG_DEBUG("command result: processing verb: " << verb);
       (verbProcessor->second)(this, request, parameters);
     }
@@ -221,6 +216,11 @@
       return;
     }
 
+  if (!parameters.hasFaceId() || parameters.getFaceId() == 0)
+    {
+      parameters.setFaceId(request->getIncomingFaceId());
+    }
+
   FaceEntry faceEntry;
   faceEntry.faceId = parameters.getFaceId();
   faceEntry.origin = parameters.getOrigin();
@@ -274,6 +274,11 @@
       return;
     }
 
+  if (!parameters.hasFaceId() || parameters.getFaceId() == 0)
+    {
+      parameters.setFaceId(request->getIncomingFaceId());
+    }
+
   FaceEntry faceEntry;
   faceEntry.faceId = parameters.getFaceId();
   faceEntry.origin = parameters.getOrigin();