Bug Fix (0) Face
diff --git a/nlsr-sync-0.0/nlsr_fib.c b/nlsr-sync-0.0/nlsr_fib.c
index e89e80d..251bf95 100755
--- a/nlsr-sync-0.0/nlsr_fib.c
+++ b/nlsr-sync-0.0/nlsr_fib.c
@@ -15,6 +15,7 @@
 #include <ccn/charbuf.h>
 
 #include "nlsr_fib.h"
+#include "nlsr.h"
 
 
 static void 
@@ -181,6 +182,12 @@
 int 
 add_delete_ccn_face_by_face_id(struct ccn *h, const char *uri, int operation, int faceid)
 {
+	if ( nlsr->debugging )
+	{
+		printf("add_delete_ccn_face_by_face_id called\n");
+		printf("Uri: %s  Face: %d Operation: %s \n",(char *)uri , faceid, operation == OP_REG ? "Registration" : "Unregistration");
+	}
+
 	struct ccn_charbuf *prefix;
 	struct ccn_charbuf *local_scope_template = ccn_charbuf_create();
 	struct ccn_charbuf *no_name = ccn_charbuf_create();
diff --git a/nlsr-sync-0.0/nlsr_npt.c b/nlsr-sync-0.0/nlsr_npt.c
index 9510aa7..f7db4b3 100755
--- a/nlsr-sync-0.0/nlsr_npt.c
+++ b/nlsr-sync-0.0/nlsr_npt.c
@@ -548,7 +548,7 @@
 		writeLogg(__FILE__,__FUNCTION__,__LINE__,"Dest Router: %s Face: %d Route_cost: %d \n",dest_router, face_id, route_cost);
 	}
 
-	print_routing_table();
+	//print_routing_table();
 	
 	int res,res1;
 	struct npt_entry *ne;
@@ -819,7 +819,7 @@
 								printf("Deleting face: Name:%s Face: %d\n",nle->name,fle->next_hop_face);
 							if ( nlsr->detailed_logging )
 								writeLogg(__FILE__,__FUNCTION__,__LINE__,"Deleting face: Name:%s Face: %d\n",nle->name,fle->next_hop_face);
-							//add_delete_ccn_face_by_face_id(nlsr->ccn, (const char *)nle->name, OP_UNREG, fle->next_hop_face);
+							add_delete_ccn_face_by_face_id(nlsr->ccn, (const char *)nle->name, OP_UNREG, fle->next_hop_face);
 						}						
 		
 
@@ -861,8 +861,6 @@
 		
 	clean_old_fib_entries_from_npt();
 
-	print_routing_table();
-
 	add_new_fib_entries_to_npt();
 	
 	int i, npt_element;
@@ -879,7 +877,7 @@
 	{
 	
 		ne=e->data;
-		//update_ccnd_fib_for_orig_router(ne->orig_router);
+		update_ccnd_fib_for_orig_router(ne->orig_router);
 		hashtb_next(e);
 	}
 	
diff --git a/nlsr-sync-0.0/nlsr_route.c b/nlsr-sync-0.0/nlsr_route.c
index 65a28f4..7754af1 100755
--- a/nlsr-sync-0.0/nlsr_route.c
+++ b/nlsr-sync-0.0/nlsr_route.c
@@ -86,7 +86,7 @@
 			print_all_path_from_source(parent,source);
 			print_all_next_hop(parent,source);		
 			update_routing_table_with_new_route(parent, dist,source);
-			print_routing_table();
+			//print_routing_table();
 		}
 		else if ( (num_link != 0) && (nlsr->multi_path_face_num > 1 ) )
 		{
@@ -100,7 +100,7 @@
 				print_all_path_from_source(parent,source);
 				print_all_next_hop(parent,source);		
 				update_routing_table_with_new_route(parent, dist,source);
-				print_routing_table();
+				//print_routing_table();
 			}
 
 			free(links);
@@ -1016,13 +1016,14 @@
 	{
 		writeLogg(__FILE__,__FUNCTION__,__LINE__,"delete_empty_rte called\n");
 		writeLogg(__FILE__,__FUNCTION__,__LINE__,"Router: %s \n",(char *)ev->evdata);
-		//writeLogg(__FILE__,__FUNCTION__,__LINE__,"print_routing_table called\n");
 	}
 	
 	if(flags == CCN_SCHEDULE_CANCEL)
 	{
  	 	return -1;
 	}
+
+	nlsr_lock();
 	int res;
 	struct hashtb_enumerator ee;
     	struct hashtb_enumerator *e = &ee;
@@ -1040,6 +1041,8 @@
 	}
 
 	print_routing_table();
+
+	nlsr_unlock();
 	
 	return 0;
 }
@@ -1176,12 +1179,11 @@
 		printf("Dest Router: %s and Face id: %d \n",dest_router, face_id);
 	}
 
-	print_routing_table();
+	//print_routing_table();
 
 	int ret=0;
 
 	int res;
-	//int res1;
 	struct routing_table_entry *rte;
 
 	struct hashtb_enumerator ee;
@@ -1221,7 +1223,7 @@
 	
 	hashtb_end(e);
 
-	print_routing_table();
+	//print_routing_table();
 
 	return ret;
 }
diff --git a/nlsr-sync-0.0/nlsr_sync.c b/nlsr-sync-0.0/nlsr_sync.c
index 2b45a1e..c63df07 100644
--- a/nlsr-sync-0.0/nlsr_sync.c
+++ b/nlsr-sync-0.0/nlsr_sync.c
@@ -710,13 +710,13 @@
 // 	Obaid: commenting out the following lines to resolve a bug. 
 //	If commenting them can resolve the issue, then we 
 //	need to call them before terminating the program.
-*/
     ccns_slice_destroy(&slice);
     ccn_charbuf_destroy(&prefix);
     ccn_charbuf_destroy(&topo);
     ccn_charbuf_destroy(&clause);
     ccn_charbuf_destroy(&slice_name);
     ccn_charbuf_destroy(&slice_uri);
+*/
 
     return 0;
 }