diff --git a/ChangeLog b/ChangeLog
index f8b6bdf..44852b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-03-14 Paul Jakma <paul.jakma@sun.com>
+
+	* (global) update all c files to match the lib/vector.h rename of
+	  (struct vector).active to max, and vector_max macro to
+	  vector_active.
+ 
 2005-03-12 Paul Jakma <paul.jakma@sun.com>
 
 	* configure.ac: Solaris 8 can use the newer lifreq based methods
diff --git a/lib/ChangeLog b/lib/ChangeLog
index cd5cec7..1040868 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -20,6 +20,10 @@
 	  (cmd_execute_command_strict) Fixup vector loop to be conditional
 	  on non-null slot.
 	  (various) Fix indentation and other whitespace.
+	  vector.h: Rename to (struct vector).max to slightly less confusing
+	  active, for the number of active slots, distinct from allocated
+	  or active-and-not-empty. Rename vector_max to vector_active 
+	  for same reason.
 
 2005-03-09 Paul Jakma <paul.jakma@sun.com>
 
diff --git a/lib/command.c b/lib/command.c
index 4586e67..6411810 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -1,5 +1,5 @@
 /*
-   $Id: command.c,v 1.45 2005/03/14 17:41:45 paul Exp $
+   $Id: command.c,v 1.46 2005/03/14 20:19:01 paul Exp $
  
    Command interpreter routine for virtual terminal [aka TeletYpe]
    Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
@@ -216,20 +216,20 @@
   vector descvec;
   struct cmd_element *cmd_element;
 
-  for (i = 0; i < vector_max (cmdvec); i++) 
+  for (i = 0; i < vector_active (cmdvec); i++) 
     if ((cnode = vector_slot (cmdvec, i)) != NULL)
       {	
 	vector cmd_vector = cnode->cmd_vector;
-	qsort (cmd_vector->index, vector_max (cmd_vector), 
+	qsort (cmd_vector->index, vector_active (cmd_vector), 
 	       sizeof (void *), cmp_node);
 
-	for (j = 0; j < vector_max (cmd_vector); j++)
+	for (j = 0; j < vector_active (cmd_vector); j++)
 	  if ((cmd_element = vector_slot (cmd_vector, j)) != NULL
-	      && vector_max (cmd_element->strvec))
+	      && vector_active (cmd_element->strvec))
 	    {
 	      descvec = vector_slot (cmd_element->strvec,
-				     vector_max (cmd_element->strvec) - 1);
-	      qsort (descvec->index, vector_max (descvec), 
+				     vector_active (cmd_element->strvec) - 1);
+	      qsort (descvec->index, vector_active (descvec), 
 	             sizeof (void *), cmp_desc);
 	    }
       }
@@ -297,7 +297,7 @@
   if (!v)
     return;
 
-  for (i = 0; i < vector_max (v); i++)
+  for (i = 0; i < vector_active (v); i++)
     if ((cp = vector_slot (v, i)) != NULL)
       XFREE (MTYPE_STRVEC, cp);
 
@@ -442,10 +442,10 @@
   vector descvec;
   struct desc *desc;
 
-  for (i = 0; i < vector_max (strvec); i++)
+  for (i = 0; i < vector_active (strvec); i++)
     if ((descvec = vector_slot (strvec, i)) != NULL)
     {
-      if ((vector_max (descvec)) == 1
+      if ((vector_active (descvec)) == 1
         && (desc = vector_slot (descvec, 0)) != NULL)
 	{
 	  if (desc->cmd == NULL || CMD_OPTION (desc->cmd))
@@ -1126,10 +1126,10 @@
   match_type = no_match;
 
   /* If command and cmd_element string does not match set NULL to vector */
-  for (i = 0; i < vector_max (v); i++)
+  for (i = 0; i < vector_active (v); i++)
     if ((cmd_element = vector_slot (v, i)) != NULL)
       {
-	if (index >= vector_max (cmd_element->strvec))
+	if (index >= vector_active (cmd_element->strvec))
 	  vector_slot (v, i) = NULL;
 	else
 	  {
@@ -1138,7 +1138,7 @@
 
 	    descvec = vector_slot (cmd_element->strvec, index);
 
-	    for (j = 0; j < vector_max (descvec); j++)
+	    for (j = 0; j < vector_active (descvec); j++)
 	      if ((desc = vector_slot (descvec, j)))
 		{
 		  str = desc->cmd;
@@ -1241,12 +1241,12 @@
   match_type = no_match;
 
   /* If command and cmd_element string does not match set NULL to vector */
-  for (i = 0; i < vector_max (v); i++)
+  for (i = 0; i < vector_active (v); i++)
     if ((cmd_element = vector_slot (v, i)) != NULL)
       {
 	/* If given index is bigger than max string vector of command,
 	   set NULL */
-	if (index >= vector_max (cmd_element->strvec))
+	if (index >= vector_active (cmd_element->strvec))
 	  vector_slot (v, i) = NULL;
 	else
 	  {
@@ -1255,7 +1255,7 @@
 
 	    descvec = vector_slot (cmd_element->strvec, index);
 
-	    for (j = 0; j < vector_max (descvec); j++)
+	    for (j = 0; j < vector_active (descvec); j++)
 	      if ((desc = vector_slot (descvec, j)))
 		{
 		  str = desc->cmd;
@@ -1347,14 +1347,14 @@
   vector descvec;
   struct desc *desc;
 
-  for (i = 0; i < vector_max (v); i++)
+  for (i = 0; i < vector_active (v); i++)
     if ((cmd_element = vector_slot (v, i)) != NULL)
       {
 	int match = 0;
 
 	descvec = vector_slot (cmd_element->strvec, index);
 
-	for (j = 0; j < vector_max (descvec); j++)
+	for (j = 0; j < vector_active (descvec); j++)
 	  if ((desc = vector_slot (descvec, j)))
 	    {
 	      enum match_type ret;
@@ -1525,7 +1525,7 @@
   unsigned int i;
   char *match;
 
-  for (i = 0; i < vector_max (v); i++)
+  for (i = 0; i < vector_active (v); i++)
     if ((match = vector_slot (v, i)) != NULL)
       if (strcmp (match, str) == 0)
 	return 0;
@@ -1540,7 +1540,7 @@
   unsigned int i;
   struct desc *desc;
 
-  for (i = 0; i < vector_max (v); i++)
+  for (i = 0; i < vector_active (v); i++)
     if ((desc = vector_slot (v, i)) != NULL)
       if (strcmp (desc->cmd, str) == 0)
 	return 1;
@@ -1575,13 +1575,13 @@
   static struct desc desc_cr = { "<cr>", "" };
 
   /* Set index. */
-  if (vector_max (vline) == 0)
+  if (vector_active (vline) == 0)
     {
       *status = CMD_ERR_NO_MATCH;
       return NULL;
     }
   else
-    index = vector_max (vline) - 1;
+    index = vector_active (vline) - 1;
   
   /* Make copy vector of current node's command vector. */
   cmd_vector = vector_copy (cmd_node_vector (cmdvec, vty->node));
@@ -1602,13 +1602,13 @@
 	    vector descvec;
 	    unsigned int j, k;
 
-	    for (j = 0; j < vector_max (cmd_vector); j++)
+	    for (j = 0; j < vector_active (cmd_vector); j++)
 	      if ((cmd_element = vector_slot (cmd_vector, j)) != NULL
-		  && (vector_max (cmd_element->strvec)))
+		  && (vector_active (cmd_element->strvec)))
 		{
 		  descvec = vector_slot (cmd_element->strvec,
-					 vector_max (cmd_element->strvec) - 1);
-		  for (k = 0; k < vector_max (descvec); k++)
+					 vector_active (cmd_element->strvec) - 1);
+		  for (k = 0; k < vector_active (descvec); k++)
 		    {
 		      struct desc *desc = vector_slot (descvec, k);
 		      vector_set (matchvec, desc);
@@ -1644,19 +1644,19 @@
     match = cmd_filter_by_completion (command, cmd_vector, index);
 
   /* Make description vector. */
-  for (i = 0; i < vector_max (cmd_vector); i++)
+  for (i = 0; i < vector_active (cmd_vector); i++)
     if ((cmd_element = vector_slot (cmd_vector, i)) != NULL)
       {
 	const char *string = NULL;
 	vector strvec = cmd_element->strvec;
 
-	/* if command is NULL, index may be equal to vector_max */
-	if (command && index >= vector_max (strvec))
+	/* if command is NULL, index may be equal to vector_active */
+	if (command && index >= vector_active (strvec))
 	  vector_slot (cmd_vector, i) = NULL;
 	else
 	  {
 	    /* Check if command is completed. */
-	    if (command == NULL && index == vector_max (strvec))
+	    if (command == NULL && index == vector_active (strvec))
 	      {
 		string = "<cr>";
 		if (!desc_unique_string (matchvec, string))
@@ -1668,7 +1668,7 @@
 		vector descvec = vector_slot (strvec, index);
 		struct desc *desc;
 
-		for (j = 0; j < vector_max (descvec); j++)
+		for (j = 0; j < vector_active (descvec); j++)
 		  if ((desc = vector_slot (descvec, j)))
 		    {
 		      string = cmd_entry_function_desc (command, desc->cmd);
@@ -1712,7 +1712,7 @@
 
       shifted_vline = vector_init (vector_count(vline));
       /* use memcpy? */
-      for (index = 1; index < vector_max (vline); index++) 
+      for (index = 1; index < vector_active (vline); index++) 
 	{
 	  vector_set_index (shifted_vline, index-1, vector_lookup(vline, index));
 	}
@@ -1778,13 +1778,13 @@
   char *command;
   int lcd;
 
-  if (vector_max (vline) == 0)
+  if (vector_active (vline) == 0)
     {
       *status = CMD_ERR_NO_MATCH;
       return NULL;
     }
   else
-    index = vector_max (vline) - 1;
+    index = vector_active (vline) - 1;
 
   /* First, filter by preceeding command string */
   for (i = 0; i < index; i++)
@@ -1818,21 +1818,21 @@
   matchvec = vector_init (INIT_MATCHVEC_SIZE);
 
   /* Now we got into completion */
-  for (i = 0; i < vector_max (cmd_vector); i++)
+  for (i = 0; i < vector_active (cmd_vector); i++)
     if ((cmd_element = vector_slot (cmd_vector, i)))
       {
 	const char *string;
 	vector strvec = cmd_element->strvec;
 
 	/* Check field length */
-	if (index >= vector_max (strvec))
+	if (index >= vector_active (strvec))
 	  vector_slot (cmd_vector, i) = NULL;
 	else
 	  {
 	    unsigned int j;
 
 	    descvec = vector_slot (strvec, index);
-	    for (j = 0; j < vector_max (descvec); j++)
+	    for (j = 0; j < vector_active (descvec); j++)
 	      if ((desc = vector_slot (descvec, j)))
 		{
 		  if ((string = 
@@ -1892,7 +1892,7 @@
 	      /* match_str = (char **) &lcdstr; */
 
 	      /* Free matchvec. */
-	      for (i = 0; i < vector_max (matchvec); i++)
+	      for (i = 0; i < vector_active (matchvec); i++)
 		{
 		  if (vector_slot (matchvec, i))
 		    XFREE (MTYPE_TMP, vector_slot (matchvec, i));
@@ -1934,7 +1934,7 @@
 
       shifted_vline = vector_init (vector_count(vline));
       /* use memcpy? */
-      for (index = 1; index < vector_max (vline); index++) 
+      for (index = 1; index < vector_active (vline); index++) 
 	{
 	  vector_set_index (shifted_vline, index-1, vector_lookup(vline, index));
 	}
@@ -1997,7 +1997,7 @@
   /* Make copy of command elements. */
   cmd_vector = vector_copy (cmd_node_vector (cmdvec, vty->node));
 
-  for (index = 0; index < vector_max (vline); index++)
+  for (index = 0; index < vector_active (vline); index++)
     if ((command = vector_slot (vline, index)))
       {
 	int ret;
@@ -2026,7 +2026,7 @@
   matched_count = 0;
   incomplete_count = 0;
 
-  for (i = 0; i < vector_max (cmd_vector); i++)
+  for (i = 0; i < vector_active (cmd_vector); i++)
     if ((cmd_element = vector_slot (cmd_vector, i)))
       {
 	if (match == vararg_match || index >= cmd_element->cmdsize)
@@ -2062,7 +2062,7 @@
   varflag = 0;
   argc = 0;
 
-  for (i = 0; i < vector_max (vline); i++)
+  for (i = 0; i < vector_active (vline); i++)
     {
       if (varflag)
 	argv[argc++] = vector_slot (vline, i);
@@ -2070,7 +2070,7 @@
 	{
 	  vector descvec = vector_slot (matched_element->strvec, i);
 
-	  if (vector_max (descvec) == 1)
+	  if (vector_active (descvec) == 1)
 	    {
 	      struct desc *desc = vector_slot (descvec, 0);
 
@@ -2117,7 +2117,7 @@
 
       shifted_vline = vector_init (vector_count(vline));
       /* use memcpy? */
-      for (index = 1; index < vector_max (vline); index++) 
+      for (index = 1; index < vector_active (vline); index++) 
 	{
 	  vector_set_index (shifted_vline, index-1, vector_lookup(vline, index));
 	}
@@ -2176,7 +2176,7 @@
   /* Make copy of command element */
   cmd_vector = vector_copy (cmd_node_vector (cmdvec, vty->node));
 
-  for (index = 0; index < vector_max (vline); index++)
+  for (index = 0; index < vector_active (vline); index++)
     if ((command = vector_slot (vline, index)))
       {
 	int ret;
@@ -2205,7 +2205,7 @@
   matched_element = NULL;
   matched_count = 0;
   incomplete_count = 0;
-  for (i = 0; i < vector_max (cmd_vector); i++)
+  for (i = 0; i < vector_active (cmd_vector); i++)
     if (vector_slot (cmd_vector, i) != NULL)
       {
 	cmd_element = vector_slot (cmd_vector, i);
@@ -2238,7 +2238,7 @@
   varflag = 0;
   argc = 0;
 
-  for (i = 0; i < vector_max (vline); i++)
+  for (i = 0; i < vector_active (vline); i++)
     {
       if (varflag)
 	argv[argc++] = vector_slot (vline, i);
@@ -2246,7 +2246,7 @@
 	{
 	  vector descvec = vector_slot (matched_element->strvec, i);
 
-	  if (vector_max (descvec) == 1)
+	  if (vector_active (descvec) == 1)
 	    {
 	      struct desc *desc = vector_slot (descvec, 0);
 
@@ -2494,7 +2494,7 @@
   struct cmd_node *cnode = vector_slot (cmdvec, vty->node);
   struct cmd_element *cmd;
 
-  for (i = 0; i < vector_max (cnode->cmd_vector); i++)
+  for (i = 0; i < vector_active (cnode->cmd_vector); i++)
     if ((cmd = vector_slot (cnode->cmd_vector, i)) != NULL
         && !(cmd->attr == CMD_ATTR_DEPRECATED
              || cmd->attr == CMD_ATTR_HIDDEN))
@@ -2558,7 +2558,7 @@
   vty_time_print (file_vty, 1);
   vty_out (file_vty, "!\n");
 
-  for (i = 0; i < vector_max (cmdvec); i++)
+  for (i = 0; i < vector_active (cmdvec); i++)
     if ((node = vector_slot (cmdvec, i)) && node->func)
       {
 	if ((*node->func) (file_vty))
@@ -2652,7 +2652,7 @@
 
   if (vty->type == VTY_SHELL_SERV)
     {
-      for (i = 0; i < vector_max (cmdvec); i++)
+      for (i = 0; i < vector_active (cmdvec); i++)
 	if ((node = vector_slot (cmdvec, i)) && node->func && node->vtysh)
 	  {
 	    if ((*node->func) (vty))
@@ -2665,7 +2665,7 @@
 	       VTY_NEWLINE);
       vty_out (vty, "!%s", VTY_NEWLINE);
 
-      for (i = 0; i < vector_max (cmdvec); i++)
+      for (i = 0; i < vector_active (cmdvec); i++)
 	if ((node = vector_slot (cmdvec, i)) && node->func)
 	  {
 	    if ((*node->func) (vty))
diff --git a/lib/routemap.c b/lib/routemap.c
index cc63e3a..2906a52 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -429,7 +429,7 @@
   unsigned int i;
   struct route_map_rule_cmd *rule;
 
-  for (i = 0; i < vector_max (route_match_vec); i++)
+  for (i = 0; i < vector_active (route_match_vec); i++)
     if ((rule = vector_slot (route_match_vec, i)) != NULL)
       if (strcmp (rule->str, name) == 0)
 	return rule;
@@ -443,7 +443,7 @@
   unsigned int i;
   struct route_map_rule_cmd *rule;
 
-  for (i = 0; i < vector_max (route_set_vec); i++)
+  for (i = 0; i < vector_active (route_set_vec); i++)
     if ((rule = vector_slot (route_set_vec, i)) != NULL)
       if (strcmp (rule->str, name) == 0)
 	return rule;
diff --git a/lib/vector.c b/lib/vector.c
index 31cdc77..7c14862 100644
--- a/lib/vector.c
+++ b/lib/vector.c
@@ -35,7 +35,7 @@
     size = 1;
 
   v->alloced = size;
-  v->max = 0;
+  v->active = 0;
   v->index = XCALLOC (MTYPE_VECTOR_INDEX, sizeof (void *) * size);
   return v;
 }
@@ -65,7 +65,7 @@
   unsigned int size;
   vector new = XCALLOC (MTYPE_VECTOR, sizeof (struct _vector));
 
-  new->max = v->max;
+  new->active = v->active;
   new->alloced = v->alloced;
 
   size = sizeof (void *) * (v->alloced);
@@ -99,10 +99,10 @@
 {
   unsigned int i;
 
-  if (v->max == 0)
+  if (v->active == 0)
     return 0;
 
-  for (i = 0; i < v->max; i++)
+  for (i = 0; i < v->active; i++)
     if (v->index[i] == 0)
       return i;
 
@@ -120,8 +120,8 @@
 
   v->index[i] = val;
 
-  if (v->max <= i)
-    v->max = i + 1;
+  if (v->active <= i)
+    v->active = i + 1;
 
   return i;
 }
@@ -134,8 +134,8 @@
 
   v->index[i] = val;
 
-  if (v->max <= i)
-    v->max = i + 1;
+  if (v->active <= i)
+    v->active = i + 1;
 
   return i;
 }
@@ -144,7 +144,7 @@
 void *
 vector_lookup (vector v, unsigned int i)
 {
-  if (i >= v->max)
+  if (i >= v->active)
     return NULL;
   return v->index[i];
 }
@@ -166,10 +166,10 @@
 
   v->index[i] = NULL;
 
-  if (i + 1 == v->max) 
+  if (i + 1 == v->active) 
     {
-      v->max--;
-      while (i && v->index[--i] == NULL && v->max--) 
+      v->active--;
+      while (i && v->index[--i] == NULL && v->active--) 
 	;				/* Is this ugly ? */
     }
 }
@@ -181,7 +181,7 @@
   unsigned int i;
   unsigned count = 0;
 
-  for (i = 0; i < v->max; i++) 
+  for (i = 0; i < v->active; i++) 
     if (v->index[i] != NULL)
       count++;
 
diff --git a/lib/vector.h b/lib/vector.h
index 7e00c39..deaf6a8 100644
--- a/lib/vector.h
+++ b/lib/vector.h
@@ -26,7 +26,7 @@
 /* struct for vector */
 struct _vector 
 {
-  unsigned int max;		/* max number of used slot */
+  unsigned int active;		/* number of active slots */
   unsigned int alloced;		/* number of allocated slot */
   void **index;			/* index to data */
 };
@@ -36,8 +36,13 @@
 
 /* (Sometimes) usefull macros.  This macro convert index expression to
  array expression. */
+/* Reference slot at given index, caller must ensure slot is active */
 #define vector_slot(V,I)  ((V)->index[(I)])
-#define vector_max(V) ((V)->max)
+/* Number of active slots. 
+ * Note that this differs from vector_count() as it the count returned
+ * will include any empty slots
+ */
+#define vector_active(V) ((V)->active)
 
 /* Prototypes. */
 vector vector_init (unsigned int size);
diff --git a/lib/vty.c b/lib/vty.c
index 89a941c..eca1523 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -975,7 +975,7 @@
 
   /* Get width of command string. */
   width = 0;
-  for (i = 0; i < vector_max (describe); i++)
+  for (i = 0; i < vector_active (describe); i++)
     if ((desc = vector_slot (describe, i)) != NULL)
       {
 	unsigned int len;
@@ -995,7 +995,7 @@
   desc_width = vty->width - (width + 6);
 
   /* Print out description. */
-  for (i = 0; i < vector_max (describe); i++)
+  for (i = 0; i < vector_active (describe); i++)
     if ((desc = vector_slot (describe, i)) != NULL)
       {
 	if (desc->cmd[0] == '\0')
@@ -2371,7 +2371,7 @@
   unsigned int i;
   struct vty *vty;
 
-  for (i = 0; i < vector_max (vtyvec); i++)
+  for (i = 0; i < vector_active (vtyvec); i++)
     if ((vty = vector_slot (vtyvec, i)) != NULL)
       if (vty->monitor)
 	{
@@ -2394,7 +2394,7 @@
   iov[1].iov_base = "\r\n";
   iov[1].iov_len = 2;
 
-  for (i = 0; i < vector_max (vtyvec); i++)
+  for (i = 0; i < vector_active (vtyvec); i++)
     {
       struct vty *vty;
       if (((vty = vector_slot (vtyvec, i)) != NULL) && vty->monitor)
@@ -2490,7 +2490,7 @@
   unsigned int i;
   struct vty *v;
 
-  for (i = 0; i < vector_max (vtyvec); i++)
+  for (i = 0; i < vector_active (vtyvec); i++)
     if ((v = vector_slot (vtyvec, i)) != NULL)
       vty_out (vty, "%svty[%d] connected from %s.%s",
 	       v->config ? "*" : " ",
@@ -2771,7 +2771,7 @@
   struct vty *vty;
   struct thread *vty_serv_thread;
 
-  for (i = 0; i < vector_max (vtyvec); i++)
+  for (i = 0; i < vector_active (vtyvec); i++)
     if ((vty = vector_slot (vtyvec, i)) != NULL)
       {
 	buffer_reset (vty->obuf);
@@ -2779,7 +2779,7 @@
 	vty_close (vty);
       }
 
-  for (i = 0; i < vector_max (Vvty_serv_thread); i++)
+  for (i = 0; i < vector_active (Vvty_serv_thread); i++)
     if ((vty_serv_thread = vector_slot (Vvty_serv_thread, i)) != NULL)
       {
 	thread_cancel (vty_serv_thread);
diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c
index 5edee77..9ce0ac6 100644
--- a/ospf6d/ospf6_lsa.c
+++ b/ospf6d/ospf6_lsa.c
@@ -92,7 +92,7 @@
   struct ospf6_lsa_handler *handler = NULL;
   unsigned int index = ntohs (type) & OSPF6_LSTYPE_FCODE_MASK;
 
-  if (index >= vector_max (ospf6_lsa_handler_vector))
+  if (index >= vector_active (ospf6_lsa_handler_vector))
     handler = &unknown_handler;
   else
     handler = vector_slot (ospf6_lsa_handler_vector, index);
@@ -760,7 +760,7 @@
         type = val;
     }
 
-  for (i = 0; i < vector_max (ospf6_lsa_handler_vector); i++)
+  for (i = 0; i < vector_active (ospf6_lsa_handler_vector); i++)
     {
       handler = vector_slot (ospf6_lsa_handler_vector, i);
       if (handler == NULL)
@@ -828,7 +828,7 @@
         type = val;
     }
 
-  for (i = 0; i < vector_max (ospf6_lsa_handler_vector); i++)
+  for (i = 0; i < vector_active (ospf6_lsa_handler_vector); i++)
     {
       handler = vector_slot (ospf6_lsa_handler_vector, i);
       if (handler == NULL)
@@ -889,7 +889,7 @@
   str = &strbuf[strlen (strbuf)];
 
   strncat (strbuf, "debug ospf6 lsa (", STRSIZE - strlen (strbuf));
-  for (i = 0; i < vector_max (ospf6_lsa_handler_vector); i++)
+  for (i = 0; i < vector_active (ospf6_lsa_handler_vector); i++)
     {
       handler = vector_slot (ospf6_lsa_handler_vector, i);
       if (handler == NULL)
@@ -911,7 +911,7 @@
   strncat (docbuf, "Debug Link State Advertisements (LSAs)\n",
            DOCSIZE - strlen (docbuf));
 
-  for (i = 0; i < vector_max (ospf6_lsa_handler_vector); i++)
+  for (i = 0; i < vector_active (ospf6_lsa_handler_vector); i++)
     {
       handler = vector_slot (ospf6_lsa_handler_vector, i);
       if (handler == NULL)
@@ -976,7 +976,7 @@
   u_int i;
   struct ospf6_lsa_handler *handler;
 
-  for (i = 0; i < vector_max (ospf6_lsa_handler_vector); i++)
+  for (i = 0; i < vector_active (ospf6_lsa_handler_vector); i++)
     {
       handler = vector_slot (ospf6_lsa_handler_vector, i);
       if (handler == NULL)
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index 68dcb01..0a01d8b 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -986,7 +986,7 @@
   unsigned int i;
   char *str;
 
-  for (i = 0; i < vector_max (rip_enable_interface); i++)
+  for (i = 0; i < vector_active (rip_enable_interface); i++)
     if ((str = vector_slot (rip_enable_interface, i)) != NULL)
       if (strcmp (str, ifname) == 0)
 	return i;
@@ -1253,7 +1253,7 @@
       }
 
   /* rip_enable_interface. */
-  for (i = 0; i < vector_max (rip_enable_interface); i++)
+  for (i = 0; i < vector_active (rip_enable_interface); i++)
     if ((str = vector_slot (rip_enable_interface, i)) != NULL)
       {
 	free (str);
@@ -1268,7 +1268,7 @@
   unsigned int i;
   char *str;
 
-  for (i = 0; i < vector_max (Vrip_passive_nondefault); i++)
+  for (i = 0; i < vector_active (Vrip_passive_nondefault); i++)
     if ((str = vector_slot (Vrip_passive_nondefault, i)) != NULL)
       if (strcmp (str, ifname) == 0)
 	return i;
@@ -1342,7 +1342,7 @@
   unsigned int i;
   char *str;
 
-  for (i = 0; i < vector_max (Vrip_passive_nondefault); i++)
+  for (i = 0; i < vector_active (Vrip_passive_nondefault); i++)
     if ((str = vector_slot (Vrip_passive_nondefault, i)) != NULL)
       {
 	free (str);
@@ -2123,7 +2123,7 @@
 	       VTY_NEWLINE);
 
   /* Interface name RIP enable statement. */
-  for (i = 0; i < vector_max (rip_enable_interface); i++)
+  for (i = 0; i < vector_active (rip_enable_interface); i++)
     if ((ifname = vector_slot (rip_enable_interface, i)) != NULL)
       vty_out (vty, "%s%s%s",
 	       config_mode ? " network " : "    ",
@@ -2142,7 +2142,7 @@
   if (config_mode) {
     if (passive_default)
       vty_out (vty, " passive-interface default%s", VTY_NEWLINE);
-    for (i = 0; i < vector_max (Vrip_passive_nondefault); i++)
+    for (i = 0; i < vector_active (Vrip_passive_nondefault); i++)
       if ((ifname = vector_slot (Vrip_passive_nondefault, i)) != NULL)
 	vty_out (vty, " %spassive-interface %s%s",
 		 (passive_default ? "no " : ""), ifname, VTY_NEWLINE);
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
index bef7699..5d317ee 100644
--- a/ripngd/ripng_interface.c
+++ b/ripngd/ripng_interface.c
@@ -644,7 +644,7 @@
   unsigned int i;
   char *str;
 
-  for (i = 0; i < vector_max (ripng_enable_if); i++)
+  for (i = 0; i < vector_active (ripng_enable_if); i++)
     if ((str = vector_slot (ripng_enable_if, i)) != NULL)
       if (strcmp (str, ifname) == 0)
 	return i;
@@ -851,7 +851,7 @@
     }
 
   /* ripng_enable_if */
-  for (i = 0; i < vector_max (ripng_enable_if); i++)
+  for (i = 0; i < vector_active (ripng_enable_if); i++)
     if ((str = vector_slot (ripng_enable_if, i)) != NULL) {
       free (str);
       vector_slot (ripng_enable_if, i) = NULL;
@@ -868,7 +868,7 @@
   unsigned int i;
   char *str;
 
-  for (i = 0; i < vector_max (Vripng_passive_interface); i++)
+  for (i = 0; i < vector_active (Vripng_passive_interface); i++)
     if ((str = vector_slot (Vripng_passive_interface, i)) != NULL)
       if (strcmp (str, ifname) == 0)
 	return i;
@@ -943,7 +943,7 @@
   unsigned int i;
   char *str;
 
-  for (i = 0; i < vector_max (Vripng_passive_interface); i++)
+  for (i = 0; i < vector_active (Vripng_passive_interface); i++)
     if ((str = vector_slot (Vripng_passive_interface, i)) != NULL)
       {
 	free (str);
@@ -975,7 +975,7 @@
       }
   
   /* Write enable interface. */
-  for (i = 0; i < vector_max (ripng_enable_if); i++)
+  for (i = 0; i < vector_active (ripng_enable_if); i++)
     if ((ifname = vector_slot (ripng_enable_if, i)) != NULL)
       vty_out (vty, "%s%s%s",
 	       config_mode ? " network " : "    ",
@@ -984,7 +984,7 @@
 
   /* Write passive interface. */
   if (config_mode)
-    for (i = 0; i < vector_max (Vripng_passive_interface); i++)
+    for (i = 0; i < vector_active (Vripng_passive_interface); i++)
       if ((ifname = vector_slot (Vripng_passive_interface, i)) != NULL)
         vty_out (vty, " passive-interface %s%s", ifname, VTY_NEWLINE);
 
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index fb41b0d..5df562c 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -587,7 +587,7 @@
 
   /* Get width of command string. */
   width = 0;
-  for (i = 0; i < vector_max (describe); i++)
+  for (i = 0; i < vector_active (describe); i++)
     if ((desc = vector_slot (describe, i)) != NULL)
       {
 	int len;
@@ -603,7 +603,7 @@
 	  width = len;
       }
 
-  for (i = 0; i < vector_max (describe); i++)
+  for (i = 0; i < vector_active (describe); i++)
     if ((desc = vector_slot (describe, i)) != NULL)
       {
 	if (desc->cmd[0] == '\0')
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c
index 14efa48..fe8d52f 100644
--- a/vtysh/vtysh_config.c
+++ b/vtysh/vtysh_config.c
@@ -309,7 +309,7 @@
   fprintf (fp, "!\n");
   fflush (fp);
 
-  for (i = 0; i < vector_max (configvec); i++)
+  for (i = 0; i < vector_active (configvec); i++)
     if ((master = vector_slot (configvec, i)) != NULL)
       {
 	LIST_LOOP (master, config, nn)
@@ -335,7 +335,7 @@
 	  }
       }
 
-  for (i = 0; i < vector_max (configvec); i++)
+  for (i = 0; i < vector_active (configvec); i++)
     if ((master = vector_slot (configvec, i)) != NULL)
       {
 	list_delete (master);
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index f93f423..8eb8061 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -105,7 +105,7 @@
   unsigned int i;
   struct vrf *vrf;
 
-  for (i = 0; i < vector_max (vrf_vector); i++)
+  for (i = 0; i < vector_active (vrf_vector); i++)
     if ((vrf = vector_slot (vrf_vector, i)) != NULL)
       if (vrf->name && name && strcmp (vrf->name, name) == 0)
 	return vrf;
