Max Faces Per Prefix behavior, LSA Refresh Time and Router Dead Interval Time
diff --git a/nlsr-sync-0.0/nlsr_npt.c b/nlsr-sync-0.0/nlsr_npt.c
index 64373fe..fb167f5 100755
--- a/nlsr-sync-0.0/nlsr_npt.c
+++ b/nlsr-sync-0.0/nlsr_npt.c
@@ -216,23 +216,22 @@
 			}
 		}
 
-		first_face=num_face-1;		
-	
-		if ( nlsr->multi_path_face_num == 0 )
+		last_face=0;
+		if ( nlsr->max_faces_per_prefix == 0) // add all faces available in routing table
 		{
-			last_face=first_face;
+			first_face=num_face-1;
 		}
-		else 
+		else if( nlsr->max_faces_per_prefix > 0)
 		{
-			if ( num_face <= nlsr->multi_path_face_num)
+			if ( nlsr->max_faces_per_prefix >= num_face)
 			{
-				last_face=0;
+				first_face=num_face-1;
 			}
-			else
+			else if ( nlsr->max_faces_per_prefix < num_face)
 			{
-				last_face=num_face-nlsr->multi_path_face_num;
+				first_face=nlsr->max_faces_per_prefix-1;
 			}
-			
+	
 		}
 
 		int i,j, nl_element;
@@ -343,24 +342,23 @@
 			sort_faces_by_distance(faces,route_costs,0,num_face);
 		
 
-			first_face=num_face-1;		
-	
-			if ( nlsr->multi_path_face_num == 0 )
+			last_face=0;
+			if ( nlsr->max_faces_per_prefix == 0) // add all faces available in routing table
 			{
-				last_face=first_face;
+				first_face=num_face-1;
 			}
-			else 
+			else if( nlsr->max_faces_per_prefix > 0)
 			{
-				if ( num_face <= nlsr->multi_path_face_num)
+				if ( nlsr->max_faces_per_prefix >= num_face)
 				{
-					last_face=0;
+					first_face=num_face-1;
 				}
-				else
+				else if ( nlsr->max_faces_per_prefix < num_face)
 				{
-					last_face=num_face-nlsr->multi_path_face_num;
+					first_face=nlsr->max_faces_per_prefix-1;
 				}
-			}			
-
+	
+			}
 			for( j=first_face; j>= last_face; j--)
 			{
 
@@ -974,7 +972,7 @@
 		get_all_faces_for_orig_router_from_npt(orig_router,faces,route_costs,num_face);
 		sort_faces_by_distance(faces,route_costs,0,num_face);
 		
-
+		/*
 		first_face=num_face-1;		
 	
 		if ( nlsr->multi_path_face_num == 0 )
@@ -992,6 +990,25 @@
 				last_face=num_face-nlsr->multi_path_face_num;
 			}
 		}
+		*/
+
+		last_face=0;
+		if ( nlsr->max_faces_per_prefix == 0) // add all faces available in routing table
+		{
+			first_face=num_face-1;
+		}
+		else if( nlsr->max_faces_per_prefix > 0)
+		{
+			if ( nlsr->max_faces_per_prefix >= num_face)
+			{
+				first_face=num_face-1;
+			}
+			else if ( nlsr->max_faces_per_prefix < num_face)
+			{
+				first_face=nlsr->max_faces_per_prefix-1;
+			}
+	
+		}
 
 		int i,j, nl_element;
 		struct name_list_entry *nle;