Bug Fix (0) Face
diff --git a/nlsr-sync-0.0/nlsr_adl.c b/nlsr-sync-0.0/nlsr_adl.c
index aabac2a..3f271a1 100755
--- a/nlsr-sync-0.0/nlsr_adl.c
+++ b/nlsr-sync-0.0/nlsr_adl.c
@@ -951,3 +951,34 @@
 	return ret;
 }
 
+int 
+is_active_neighbor(char *nbr)
+{
+	int ret=0;
+
+	int res;
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = ⅇ
+
+	hashtb_start(nlsr->adl, e);
+	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
+
+	if( res == HT_OLD_ENTRY )
+	{
+		struct ndn_neighbor *nnbr;
+		nnbr=e->data;
+		if (nnbr->status == NBR_ACTIVE )
+		{
+			ret=1;	
+		}
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+
+	return ret;
+}
+
diff --git a/nlsr-sync-0.0/nlsr_adl.h b/nlsr-sync-0.0/nlsr_adl.h
index af00a2f..1eb74d6 100755
--- a/nlsr-sync-0.0/nlsr_adl.h
+++ b/nlsr-sync-0.0/nlsr_adl.h
@@ -49,5 +49,6 @@
 void adjust_adjacent_last_lsdb_requested_to_adl(char *nbr, long int sec);
 int get_next_hop_face_from_adl(char *nbr);
 int is_neighbor(char *nbr);
+int is_active_neighbor(char *nbr);
 void update_face_to_adl_for_nbr(char *nbr, int face);
 #endif
diff --git a/nlsr-sync-0.0/nlsr_npt.c b/nlsr-sync-0.0/nlsr_npt.c
index 598b04f..e30eb6d 100755
--- a/nlsr-sync-0.0/nlsr_npt.c
+++ b/nlsr-sync-0.0/nlsr_npt.c
@@ -249,7 +249,7 @@
 
 				printf("FIB Entry Name: %s Face: %d Router Cost: %d \n",nle->name,faces[j],route_costs[j]);
 
-				if ( is_neighbor(orig_router) == 0 )
+				if ( is_active_neighbor(orig_router) == 0 )
 				{
 					if ( nlsr->debugging )
 						printf("Adding face: Name:%s Face: %d\n",nle->name,faces[j]);	
@@ -259,7 +259,7 @@
 				}
 				else 
 				{
-					if ( j == last_face && is_neighbor(nle->name)==0)
+					if ( j == last_face &&  is_active_neighbor(nle->name)==0)
 					{
 						if ( nlsr->debugging )
 							printf("Adding face: Name:%s Face: %d\n",nle->name,faces[j]);	
@@ -360,7 +360,7 @@
 			for( j=first_face; j>= last_face; j--)
 			{
 
-				if ( is_neighbor(orig_router) == 0 )
+				if ( is_active_neighbor(orig_router) == 0 )
 				{
 					if ( nlsr->debugging )
 						printf("Deleting face: Name:%s Face: %d\n",nle->name,faces[j]);	
@@ -370,7 +370,7 @@
 				}
 				else 
 				{
-					if ( j == last_face && is_neighbor(nle->name)==0)
+					if ( j == last_face && is_active_neighbor(nle->name)==0)
 					{
 						if ( nlsr->debugging )
 							printf("Deleting face: Name:%s Face: %d\n",nle->name,faces[j]);	
@@ -832,7 +832,7 @@
 					for (k=0;k<nl_element;k++)
 					{
 						nle=enle->data;
-						if( is_neighbor(nle->name) == 0 )
+						if( is_active_neighbor(nle->name) == 0 )
 						{
 							if ( nlsr->debugging )
 								printf("Deleting face: Name:%s Face: %d\n",nle->name,fle->next_hop_face);
@@ -1043,7 +1043,7 @@
 			
 			for( j=first_face; j>= last_face; j--)
 			{
-				if ( is_neighbor(orig_router) == 0 )
+				if ( is_active_neighbor(orig_router) == 0 )
 				{
 					if ( nlsr->debugging )
 						printf("Deleting face: Name:%s Face: %d\n",nle->name,faces[j]);
@@ -1053,7 +1053,7 @@
 				}
 				else 
 				{
-					if ( j == last_face && is_neighbor(nle->name)==0)
+					if ( j == last_face && is_active_neighbor(nle->name)==0)
 					{
 						if ( nlsr->debugging )
 							printf("Deleting face: Name:%s Face: %d\n",nle->name,faces[j]);