diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index 0e2d528..c1ca177 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -1,5 +1,10 @@
 2005-02-02 Akihiro Mizutani <mizutani@net-chef.net>
 
+	* bgp_clist.[ch], bgp_route.c, bgp_routemap.c, bgp_vty.c:
+	  community-list cleanup.
+
+2005-02-02 Akihiro Mizutani <mizutani@net-chef.net>
+
 	* bgp_route.c, bgp_vty.c, bgp_zebra.c, bgpd.[ch]: "enforce-multihop"
 	  -> "disable-connected-check".
 
diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c
index 572d11c..b36f234 100644
--- a/bgpd/bgp_clist.c
+++ b/bgpd/bgp_clist.c
@@ -34,20 +34,16 @@
 /* Lookup master structure for community-list or
    extcommunity-list.  */
 struct community_list_master *
-community_list_master_lookup (struct community_list_handler *ch, int style)
+community_list_master_lookup (struct community_list_handler *ch, int master)
 {
   if (ch)
-    switch (style)
+    switch (master)
       {
-      case COMMUNITY_LIST_STANDARD:
-      case COMMUNITY_LIST_EXPANDED:
-      case COMMUNITY_LIST_AUTO:
-        return &ch->community_list;
-        break;
-      case EXTCOMMUNITY_LIST_STANDARD:
-      case EXTCOMMUNITY_LIST_EXPANDED:
-      case EXTCOMMUNITY_LIST_AUTO:
-        return &ch->extcommunity_list;
+      case COMMUNITY_LIST_MASTER:
+	return &ch->community_list;
+	break;
+      case EXTCOMMUNITY_LIST_MASTER:
+	return &ch->extcommunity_list;
       }
   return NULL;
 }
@@ -115,7 +111,7 @@
 
 struct community_list *
 community_list_insert (struct community_list_handler *ch,
-                       const char *name, int style)
+		       const char *name, int master)
 {
   size_t i;
   long number;
@@ -125,7 +121,7 @@
   struct community_list_master *cm;
 
   /* Lookup community-list master.  */
-  cm = community_list_master_lookup (ch, style);
+  cm = community_list_master_lookup (ch, master);
   if (!cm)
     return NULL;
 
@@ -209,7 +205,7 @@
 
 struct community_list *
 community_list_lookup (struct community_list_handler *ch,
-                       const char *name, int style)
+		       const char *name, int master)
 {
   struct community_list *list;
   struct community_list_master *cm;
@@ -217,7 +213,7 @@
   if (!name)
     return NULL;
 
-  cm = community_list_master_lookup (ch, style);
+  cm = community_list_master_lookup (ch, master);
   if (!cm)
     return NULL;
 
@@ -232,14 +228,14 @@
 }
 
 struct community_list *
-community_list_get (struct community_list_handler *ch, 
-                    const char *name, int style)
+community_list_get (struct community_list_handler *ch,
+		    const char *name, int master)
 {
   struct community_list *list;
 
-  list = community_list_lookup (ch, name, style);
+  list = community_list_lookup (ch, name, master);
   if (!list)
-    list = community_list_insert (ch, name, style);
+    list = community_list_insert (ch, name, master);
   return list;
 }
 
@@ -609,15 +605,13 @@
 community_list_set (struct community_list_handler *ch,
                     const char *name, const char *str, int direct, int style)
 {
-  struct community_entry *entry;
+  struct community_entry *entry = NULL;
   struct community_list *list;
-  struct community *com;
-  regex_t *regex;
-
-  entry = NULL;
+  struct community *com = NULL;
+  regex_t *regex = NULL;
 
   /* Get community list. */
-  list = community_list_get (ch, name, style);
+  list = community_list_get (ch, name, COMMUNITY_LIST_MASTER);
 
   /* When community-list already has entry, new entry should have same
      style.  If you want to have mixed style community-list, you can
@@ -628,68 +622,33 @@
 
       first = list->head;
 
-      if (style == COMMUNITY_LIST_AUTO)
-        style = first->style;
-      else if (style != first->style)
-        {
-          return (first->style == COMMUNITY_LIST_STANDARD
-                  ? COMMUNITY_LIST_ERR_STANDARD_CONFLICT
-                  : COMMUNITY_LIST_ERR_EXPANDED_CONFLICT);
-        }
+      if (style != first->style)
+	{
+	  return (first->style == COMMUNITY_LIST_STANDARD
+		  ? COMMUNITY_LIST_ERR_STANDARD_CONFLICT
+		  : COMMUNITY_LIST_ERR_EXPANDED_CONFLICT);
+	}
     }
 
-  /* When str is NULL, it is matches any.  */
-  if (!str)
+  if (str)
     {
-      entry = community_entry_new ();
-      entry->direct = direct;
-      entry->any = 1;
-      if (style == COMMUNITY_LIST_AUTO)
-        entry->style = COMMUNITY_LIST_STANDARD;
+      if (style == COMMUNITY_LIST_STANDARD)
+	com = community_str2com (str);
       else
-        entry->style = style;
-    }
-  else
-    {
-      /* Standard community-list parse.  String must be converted into
-         community structure without problem.  */
-      if (style == COMMUNITY_LIST_STANDARD || style == COMMUNITY_LIST_AUTO)
-        {
-          com = community_str2com (str);
-          if (com)
-            {
-              entry = community_entry_new ();
-              entry->u.com = com;
-              entry->direct = direct;
-              entry->style = COMMUNITY_LIST_STANDARD;
-            }
-          else if (style == COMMUNITY_LIST_STANDARD)
-            return COMMUNITY_LIST_ERR_MALFORMED_VAL;
+	regex = bgp_regcomp (str);
 
-          /* We can't convert string into communities value.  When
-             community-list type is auto, fall dawn to regular expression
-             match.  */
-        }
-
-      /* Expanded community-list parse.  String may include regular
-         expression.  */
-      if (!entry && (style == COMMUNITY_LIST_EXPANDED
-                     || style == COMMUNITY_LIST_AUTO))
-        {
-          regex = bgp_regcomp (str);
-          if (regex)
-            {
-              entry = community_entry_new ();
-              entry->reg = regex;
-              entry->config = XSTRDUP (MTYPE_COMMUNITY_LIST_CONFIG, str);
-              entry->direct = direct;
-              entry->style = COMMUNITY_LIST_EXPANDED;
-            }
-          else
-            return COMMUNITY_LIST_ERR_MALFORMED_VAL;
-        }
+      if (! com && ! regex)
+	return COMMUNITY_LIST_ERR_MALFORMED_VAL;
     }
 
+  entry = community_entry_new ();
+  entry->direct = direct;
+  entry->style = style;
+  entry->any = (str ? 0 : 1);
+  entry->u.com = com;
+  entry->reg = regex;
+  entry->config = (regex ? XSTRDUP (MTYPE_COMMUNITY_LIST_CONFIG, str) : NULL);
+
   /* Do not put duplicated community entry.  */
   if (community_list_dup_check (list, entry))
     community_entry_free (entry);
@@ -706,15 +665,13 @@
                       const char *name, const char *str, 
                       int direct, int style)
 {
-  struct community_entry *entry;
+  struct community_entry *entry = NULL;
   struct community_list *list;
-  struct community *com;
-  regex_t *regex;
-
-  entry = NULL;
+  struct community *com = NULL;
+  regex_t *regex = NULL;
 
   /* Lookup community list.  */
-  list = community_list_lookup (ch, name, style);
+  list = community_list_lookup (ch, name, COMMUNITY_LIST_MASTER);
   if (list == NULL)
     return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
 
@@ -725,37 +682,23 @@
       return 0;
     }
 
-  /* Community list string is specified.  Lookup entry from community
-     list.  */
-  if (style == COMMUNITY_LIST_STANDARD || style == COMMUNITY_LIST_AUTO)
-    {
-      com = community_str2com (str);
-      if (com)
-        {
-          entry = community_list_entry_lookup (list, com, direct);
-          community_free (com);
-        }
-      else if (style == COMMUNITY_LIST_STANDARD)
-        return COMMUNITY_LIST_ERR_MALFORMED_VAL;
+  if (style == COMMUNITY_LIST_STANDARD)
+    com = community_str2com (str);
+  else
+    regex = bgp_regcomp (str);
 
-      /* If we can't convert string into community and community-list
-         type is auto, fall dawn to expanded community-list.  */
-    }
+  if (! com && ! regex)
+    return COMMUNITY_LIST_ERR_MALFORMED_VAL;
 
-  /* Expanded community-list parse.  String may include regular
-     expression.  */
-  if (!entry
-      && (style == COMMUNITY_LIST_EXPANDED || style == COMMUNITY_LIST_AUTO))
-    {
-      regex = bgp_regcomp (str);
-      if (regex)
-        {
-          entry = community_list_entry_lookup (list, str, direct);
-          bgp_regex_free (regex);
-        }
-      else
-        return COMMUNITY_LIST_ERR_MALFORMED_VAL;
-    }
+  if (com)
+    entry = community_list_entry_lookup (list, com, direct);
+  else
+    entry = community_list_entry_lookup (list, str, direct);
+
+  if (com)
+    community_free (com);
+  if (regex)
+    bgp_regex_free (regex);
 
   if (!entry)
     return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
@@ -771,15 +714,15 @@
                        const char *name, const char *str, 
                        int direct, int style)
 {
-  struct community_entry *entry;
+  struct community_entry *entry = NULL;
   struct community_list *list;
-  struct ecommunity *ecom;
-  regex_t *regex;
+  struct ecommunity *ecom = NULL;
+  regex_t *regex = NULL;
 
   entry = NULL;
 
   /* Get community list. */
-  list = community_list_get (ch, name, style);
+  list = community_list_get (ch, name, EXTCOMMUNITY_LIST_MASTER);
 
   /* When community-list already has entry, new entry should have same
      style.  If you want to have mixed style community-list, you can
@@ -790,74 +733,40 @@
 
       first = list->head;
 
-      if (style == EXTCOMMUNITY_LIST_AUTO)
-        style = first->style;
-      else if (style != first->style)
-        {
-          return (first->style == EXTCOMMUNITY_LIST_STANDARD
-                  ? COMMUNITY_LIST_ERR_STANDARD_CONFLICT
-                  : COMMUNITY_LIST_ERR_EXPANDED_CONFLICT);
-        }
+      if (style != first->style)
+	{
+	  return (first->style == EXTCOMMUNITY_LIST_STANDARD
+		  ? COMMUNITY_LIST_ERR_STANDARD_CONFLICT
+		  : COMMUNITY_LIST_ERR_EXPANDED_CONFLICT);
+	}
     }
 
-  /* When str is NULL, it is matches any.  */
-  if (!str)
+  if (str)
     {
-      entry = community_entry_new ();
-      entry->direct = direct;
-      entry->any = 1;
-      if (style == EXTCOMMUNITY_LIST_AUTO)
-        entry->style = EXTCOMMUNITY_LIST_STANDARD;
+      if (style == EXTCOMMUNITY_LIST_STANDARD)
+	ecom = ecommunity_str2com (str, 0, 1);
       else
-        entry->style = style;
+	regex = bgp_regcomp (str);
+
+      if (! ecom && ! regex)
+	return COMMUNITY_LIST_ERR_MALFORMED_VAL;
     }
+
+  if (ecom)
+    ecom->str = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_DISPLAY);
+
+  entry = community_entry_new ();
+  entry->direct = direct;
+  entry->style = style;
+  entry->any = (str ? 0 : 1);
+  if (ecom)
+    entry->config = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_COMMUNITY_LIST);
+  else if (regex)
+    entry->config = XSTRDUP (MTYPE_COMMUNITY_LIST_CONFIG, str);
   else
-    {
-      /* Standard extcommunity-list parse.  String is converted into
-         ecommunity structure.  */
-      if (style == EXTCOMMUNITY_LIST_STANDARD
-          || style == EXTCOMMUNITY_LIST_AUTO)
-        {
-          /* Type is unknown.  String includes keyword.  */
-          ecom = ecommunity_str2com (str, 0, 1);
-          if (ecom)
-            {
-              entry = community_entry_new ();
-              entry->config
-                =
-                ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_COMMUNITY_LIST);
-              ecom->str =
-                ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_DISPLAY);
-              entry->u.ecom = ecom;
-              entry->direct = direct;
-              entry->style = EXTCOMMUNITY_LIST_STANDARD;
-            }
-          else if (style == EXTCOMMUNITY_LIST_STANDARD)
-            return COMMUNITY_LIST_ERR_MALFORMED_VAL;
-
-          /* We can't convert string into communities value.  When
-             community-list type is auto, fall dawn to regular expression
-             match.  */
-        }
-
-      /* Expanded extcommunity-list parse.  String may include regular
-         expression.  */
-      if (!entry && (style == EXTCOMMUNITY_LIST_EXPANDED
-                     || style == EXTCOMMUNITY_LIST_AUTO))
-        {
-          regex = bgp_regcomp (str);
-          if (regex)
-            {
-              entry = community_entry_new ();
-              entry->reg = regex;
-              entry->config = XSTRDUP (MTYPE_COMMUNITY_LIST_CONFIG, str);
-              entry->direct = direct;
-              entry->style = EXTCOMMUNITY_LIST_EXPANDED;
-            }
-          else
-            return COMMUNITY_LIST_ERR_MALFORMED_VAL;
-        }
-    }
+    entry->config = NULL;
+  entry->u.ecom = ecom;
+  entry->reg = regex;
 
   /* Do not put duplicated community entry.  */
   if (community_list_dup_check (list, entry))
@@ -875,15 +784,13 @@
                          const char *name, const char *str, 
                          int direct, int style)
 {
-  struct community_entry *entry;
+  struct community_entry *entry = NULL;
   struct community_list *list;
   struct ecommunity *ecom = NULL;
-  regex_t *regex;
-
-  entry = NULL;
+  regex_t *regex = NULL;
 
   /* Lookup extcommunity list.  */
-  list = community_list_lookup (ch, name, style);
+  list = community_list_lookup (ch, name, EXTCOMMUNITY_LIST_MASTER);
   if (list == NULL)
     return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
 
@@ -894,37 +801,23 @@
       return 0;
     }
 
-  /* Community list string is specified.  Lookup entry from community
-     list.  */
-  if (style == EXTCOMMUNITY_LIST_STANDARD || style == EXTCOMMUNITY_LIST_AUTO)
-    {
-      ecom = ecommunity_str2com (str, 0, 1);
-      if (ecom)
-        {
-          entry = community_list_entry_lookup (list, ecom, direct);
-          ecommunity_free (ecom);
-        }
-      else if (style == COMMUNITY_LIST_STANDARD)
-        return COMMUNITY_LIST_ERR_MALFORMED_VAL;
+  if (style == EXTCOMMUNITY_LIST_STANDARD)
+    ecom = ecommunity_str2com (str, 0, 1);
+  else
+    regex = bgp_regcomp (str);
 
-      /* If we can't convert string into community and community-list
-         type is auto, fall dawn to expanded community-list.  */
-    }
+  if (! ecom && ! regex)
+    return COMMUNITY_LIST_ERR_MALFORMED_VAL;
 
-  /* Expanded community-list parse.  String may include regular
-     expression.  */
-  if (!entry
-      && (style == COMMUNITY_LIST_EXPANDED || style == COMMUNITY_LIST_AUTO))
-    {
-      regex = bgp_regcomp (str);
-      if (regex)
-        {
-          entry = community_list_entry_lookup (list, str, direct);
-          bgp_regex_free (regex);
-        }
-      else
-        return COMMUNITY_LIST_ERR_MALFORMED_VAL;
-    }
+  if (ecom)
+    entry = community_list_entry_lookup (list, ecom, direct);
+  else
+    entry = community_list_entry_lookup (list, str, direct);
+
+  if (ecom)
+    ecommunity_free (ecom);
+  if (regex)
+    bgp_regex_free (regex);
 
   if (!entry)
     return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
diff --git a/bgpd/bgp_clist.h b/bgpd/bgp_clist.h
index 11db2d7..6f1faf0 100644
--- a/bgpd/bgp_clist.h
+++ b/bgpd/bgp_clist.h
@@ -18,6 +18,10 @@
 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
+/* Master Community-list. */
+#define COMMUNITY_LIST_MASTER          0
+#define EXTCOMMUNITY_LIST_MASTER       1
+
 /* Community-list deny and permit.  */
 #define COMMUNITY_DENY                 0
 #define COMMUNITY_PERMIT               1
@@ -29,10 +33,8 @@
 /* Community-list entry types.  */
 #define COMMUNITY_LIST_STANDARD        0 /* Standard community-list.  */
 #define COMMUNITY_LIST_EXPANDED        1 /* Expanded community-list.  */
-#define COMMUNITY_LIST_AUTO            2 /* Automatically detected.  */
-#define EXTCOMMUNITY_LIST_STANDARD     3 /* Standard extcommunity-list.  */
-#define EXTCOMMUNITY_LIST_EXPANDED     4 /* Expanded extcommunity-list.  */
-#define EXTCOMMUNITY_LIST_AUTO         5 /* Automatically detected.  */
+#define EXTCOMMUNITY_LIST_STANDARD     2 /* Standard extcommunity-list.  */
+#define EXTCOMMUNITY_LIST_EXPANDED     3 /* Expanded extcommunity-list.  */
 
 /* Community-list.  */
 struct community_list
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index a3be9f0..156120b 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -7767,7 +7767,7 @@
 {
   struct community_list *list;
 
-  list = community_list_lookup (bgp_clist, com, COMMUNITY_LIST_AUTO);
+  list = community_list_lookup (bgp_clist, com, COMMUNITY_LIST_MASTER);
   if (list == NULL)
     {
       vty_out (vty, "%% %s is not a valid community-list name%s", com,
@@ -7782,11 +7782,12 @@
 
 DEFUN (show_ip_bgp_community_list,
        show_ip_bgp_community_list_cmd,
-       "show ip bgp community-list WORD",
+       "show ip bgp community-list (<1-500>|WORD)",
        SHOW_STR
        IP_STR
        BGP_STR
        "Display routes matching the community-list\n"
+       "community-list number\n"
        "community-list name\n")
 {
   return bgp_show_community_list (vty, argv[0], 0, AFI_IP, SAFI_UNICAST);
@@ -7794,7 +7795,7 @@
 
 DEFUN (show_ip_bgp_ipv4_community_list,
        show_ip_bgp_ipv4_community_list_cmd,
-       "show ip bgp ipv4 (unicast|multicast) community-list WORD",
+       "show ip bgp ipv4 (unicast|multicast) community-list (<1-500>|WORD)",
        SHOW_STR
        IP_STR
        BGP_STR
@@ -7802,6 +7803,7 @@
        "Address Family modifier\n"
        "Address Family modifier\n"
        "Display routes matching the community-list\n"
+       "community-list number\n"
        "community-list name\n")
 {
   if (strncmp (argv[0], "m", 1) == 0)
@@ -7812,11 +7814,12 @@
 
 DEFUN (show_ip_bgp_community_list_exact,
        show_ip_bgp_community_list_exact_cmd,
-       "show ip bgp community-list WORD exact-match",
+       "show ip bgp community-list (<1-500>|WORD) exact-match",
        SHOW_STR
        IP_STR
        BGP_STR
        "Display routes matching the community-list\n"
+       "community-list number\n"
        "community-list name\n"
        "Exact match of the communities\n")
 {
@@ -7825,7 +7828,7 @@
 
 DEFUN (show_ip_bgp_ipv4_community_list_exact,
        show_ip_bgp_ipv4_community_list_exact_cmd,
-       "show ip bgp ipv4 (unicast|multicast) community-list WORD exact-match",
+       "show ip bgp ipv4 (unicast|multicast) community-list (<1-500>|WORD) exact-match",
        SHOW_STR
        IP_STR
        BGP_STR
@@ -7833,6 +7836,7 @@
        "Address Family modifier\n"
        "Address Family modifier\n"
        "Display routes matching the community-list\n"
+       "community-list number\n"
        "community-list name\n"
        "Exact match of the communities\n")
 {
@@ -7845,10 +7849,11 @@
 #ifdef HAVE_IPV6
 DEFUN (show_bgp_community_list,
        show_bgp_community_list_cmd,
-       "show bgp community-list WORD",
+       "show bgp community-list (<1-500>|WORD)",
        SHOW_STR
        BGP_STR
        "Display routes matching the community-list\n"
+       "community-list number\n"
        "community-list name\n")
 {
   return bgp_show_community_list (vty, argv[0], 0, AFI_IP6, SAFI_UNICAST);
@@ -7856,12 +7861,13 @@
 
 ALIAS (show_bgp_community_list,
        show_bgp_ipv6_community_list_cmd,
-       "show bgp ipv6 community-list WORD",
+       "show bgp ipv6 community-list (<1-500>|WORD)",
        SHOW_STR
        BGP_STR
        "Address family\n"
        "Display routes matching the community-list\n"
-       "community-list name\n")
+       "community-list number\n"
+       "community-list name\n");
 
 /* old command */
 DEFUN (show_ipv6_bgp_community_list,
@@ -7891,10 +7897,11 @@
 
 DEFUN (show_bgp_community_list_exact,
        show_bgp_community_list_exact_cmd,
-       "show bgp community-list WORD exact-match",
+       "show bgp community-list (<1-500>|WORD) exact-match",
        SHOW_STR
        BGP_STR
        "Display routes matching the community-list\n"
+       "community-list number\n"
        "community-list name\n"
        "Exact match of the communities\n")
 {
@@ -7903,11 +7910,12 @@
 
 ALIAS (show_bgp_community_list_exact,
        show_bgp_ipv6_community_list_exact_cmd,
-       "show bgp ipv6 community-list WORD exact-match",
+       "show bgp ipv6 community-list (<1-500>|WORD) exact-match",
        SHOW_STR
        BGP_STR
        "Address family\n"
        "Display routes matching the community-list\n"
+       "community-list number\n"
        "community-list name\n"
        "Exact match of the communities\n")
 
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 7674005..73165d3 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -556,7 +556,7 @@
       bgp_info = object;
       rcom = rule;
 
-      list = community_list_lookup (bgp_clist, rcom->name, COMMUNITY_LIST_AUTO);
+      list = community_list_lookup (bgp_clist, rcom->name, COMMUNITY_LIST_MASTER);
       if (! list)
 	return RMAP_NOMATCH;
 
@@ -632,7 +632,7 @@
       bgp_info = object;
 
       list = community_list_lookup (bgp_clist, (char *) rule,
-				    EXTCOMMUNITY_LIST_AUTO);
+				    EXTCOMMUNITY_LIST_MASTER);
       if (! list)
 	return RMAP_NOMATCH;
 
@@ -1225,7 +1225,7 @@
   route_set_community_free,
 };
 
-/* `set comm-list (<1-99>|<100-199>|WORD) delete' */
+/* `set comm-list (<1-99>|<100-500>|WORD) delete' */
 
 /* For community set mechanism. */
 route_map_result_t
@@ -1244,7 +1244,7 @@
 	return RMAP_OKAY;
 
       binfo = object;
-      list = community_list_lookup (bgp_clist, rule, COMMUNITY_LIST_AUTO);
+      list = community_list_lookup (bgp_clist, rule, COMMUNITY_LIST_MASTER);
       old = binfo->attr->community;
 
       if (list && old)
@@ -2412,7 +2412,7 @@
 
 DEFUN (match_community, 
        match_community_cmd,
-       "match community (<1-99>|<100-199>|WORD)",
+       "match community (<1-99>|<100-500>|WORD)",
        MATCH_STR
        "Match BGP community list\n"
        "Community-list number (standard)\n"
@@ -2424,7 +2424,7 @@
 
 DEFUN (match_community_exact, 
        match_community_exact_cmd,
-       "match community (<1-99>|<100-199>|WORD) exact-match",
+       "match community (<1-99>|<100-500>|WORD) exact-match",
        MATCH_STR
        "Match BGP community list\n"
        "Community-list number (standard)\n"
@@ -2459,7 +2459,7 @@
 
 ALIAS (no_match_community,
        no_match_community_val_cmd,
-       "no match community (<1-99>|<100-199>|WORD)",
+       "no match community (<1-99>|<100-500>|WORD)",
        NO_STR
        MATCH_STR
        "Match BGP community list\n"
@@ -2469,7 +2469,7 @@
 
 ALIAS (no_match_community,
        no_match_community_exact_cmd,
-       "no match community (<1-99>|<100-199>|WORD) exact-match",
+       "no match community (<1-99>|<100-500>|WORD) exact-match",
        NO_STR
        MATCH_STR
        "Match BGP community list\n"
@@ -2480,7 +2480,7 @@
 
 DEFUN (match_ecommunity, 
        match_ecommunity_cmd,
-       "match extcommunity (<1-99>|<100-199>|WORD)",
+       "match extcommunity (<1-99>|<100-500>|WORD)",
        MATCH_STR
        "Match BGP/VPN extended community list\n"
        "Extended community-list number (standard)\n"
@@ -2502,7 +2502,7 @@
 
 ALIAS (no_match_ecommunity,
        no_match_ecommunity_val_cmd,
-       "no match extcommunity (<1-99>|<100-199>|WORD)",
+       "no match extcommunity (<1-99>|<100-500>|WORD)",
        NO_STR
        MATCH_STR
        "Match BGP/VPN extended community list\n"
@@ -2913,7 +2913,7 @@
 
 DEFUN (set_community_delete,
        set_community_delete_cmd,
-       "set comm-list (<1-99>|<100-199>|WORD) delete",
+       "set comm-list (<1-99>|<100-500>|WORD) delete",
        SET_STR
        "set BGP community list (for deletion)\n"
        "Community-list number (standard)\n"
@@ -2945,7 +2945,7 @@
 
 ALIAS (no_set_community_delete,
        no_set_community_delete_val_cmd,
-       "no set comm-list (<1-99>|<100-199>|WORD) delete",
+       "no set comm-list (<1-99>|<100-500>|WORD) delete",
        NO_STR
        SET_STR
        "set BGP community list (for deletion)\n"
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 58aec8e..412b91d 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -9597,52 +9597,40 @@
   return CMD_SUCCESS;
 }
 
-/* Community-list delete with name.  */
-int
-community_list_unset_all_vty (struct vty *vty, const char *name)
-{
-  int ret;
-
-  ret = community_list_unset (bgp_clist, name, NULL, 0, COMMUNITY_LIST_AUTO);
-
-  if (ret < 0)
-    {
-      community_list_perror (vty, ret);
-      return CMD_WARNING;
-    }
-  return CMD_SUCCESS;
-}
-
 /* Communiyt-list entry delete.  */
 int
-community_list_unset_vty (struct vty *vty, int argc, const char **argv, 
-                          int style)
+community_list_unset_vty (struct vty *vty, int argc, const char **argv,
+			  int style)
 {
   int ret;
-  int direct;
-  char *str;
+  int direct = 0;
+  char *str = NULL;
 
-  /* Check the list direct. */
-  if (strncmp (argv[1], "p", 1) == 0)
-    direct = COMMUNITY_PERMIT;
-  else if (strncmp (argv[1], "d", 1) == 0)
-    direct = COMMUNITY_DENY;
-  else
+  if (argc > 1)
     {
-      vty_out (vty, "%% Matching condition must be permit or deny%s",
-	       VTY_NEWLINE);
-      return CMD_WARNING;
-    }
+      /* Check the list direct. */
+      if (strncmp (argv[1], "p", 1) == 0)
+	direct = COMMUNITY_PERMIT;
+      else if (strncmp (argv[1], "d", 1) == 0)
+	direct = COMMUNITY_DENY;
+      else
+	{
+	  vty_out (vty, "%% Matching condition must be permit or deny%s",
+		   VTY_NEWLINE);
+	  return CMD_WARNING;
+	}
 
-  /* Concat community string argument.  */
-  str = argv_concat (argv, argc, 2);
+      /* Concat community string argument.  */
+      str = argv_concat (argv, argc, 2);
+    }
 
   /* Unset community list.  */
   ret = community_list_unset (bgp_clist, argv[0], str, direct, style);
 
   /* Free temporary community list string allocated by
      argv_concat().  */
-  XFREE (MTYPE_TMP, str);
+  if (str)
+    XFREE (MTYPE_TMP, str);
 
   if (ret < 0)
     {
@@ -9657,19 +9645,6 @@
 #define COMMUNITY_LIST_STR "Add a community list entry\n"
 #define COMMUNITY_VAL_STR  "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n"
 
-DEFUN (ip_community_list,
-       ip_community_list_cmd,
-       "ip community-list WORD (deny|permit) .AA:NN",
-       IP_STR
-       COMMUNITY_LIST_STR
-       "Community list name\n"
-       "Specify community to reject\n"
-       "Specify community to accept\n"
-       COMMUNITY_VAL_STR)
-{
-  return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_AUTO, 1);
-}
-
 DEFUN (ip_community_list_standard,
        ip_community_list_standard_cmd,
        "ip community-list <1-99> (deny|permit) .AA:NN",
@@ -9694,7 +9669,7 @@
 
 DEFUN (ip_community_list_expanded,
        ip_community_list_expanded_cmd,
-       "ip community-list <100-199> (deny|permit) .LINE",
+       "ip community-list <100-500> (deny|permit) .LINE",
        IP_STR
        COMMUNITY_LIST_STR
        "Community list number (expanded)\n"
@@ -9743,44 +9718,50 @@
   return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED, 1);
 }
 
-DEFUN (no_ip_community_list_all,
-       no_ip_community_list_all_cmd,
-       "no ip community-list (WORD|<1-99>|<100-199>)",
+DEFUN (no_ip_community_list_standard_all,
+       no_ip_community_list_standard_all_cmd,
+       "no ip community-list <1-99>",
        NO_STR
        IP_STR
        COMMUNITY_LIST_STR
-       "Community list name\n"
-       "Community list number (standard)\n"
-       "Community list number (expanded)\n")
+       "Community list number (standard)\n")
 {
-  return community_list_unset_all_vty (vty, argv[0]);
+  return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
 }
 
-DEFUN (no_ip_community_list_name_all,
-       no_ip_community_list_name_all_cmd,
-       "no ip community-list (standard|expanded) WORD",
+DEFUN (no_ip_community_list_expanded_all,
+       no_ip_community_list_expanded_all_cmd,
+       "no ip community-list <100-500>",
+       NO_STR
+       IP_STR
+       COMMUNITY_LIST_STR
+       "Community list number (expanded)\n")
+{
+  return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
+}
+
+DEFUN (no_ip_community_list_name_standard_all,
+       no_ip_community_list_name_standard_all_cmd,
+       "no ip community-list standard WORD",
        NO_STR
        IP_STR
        COMMUNITY_LIST_STR
        "Add a standard community-list entry\n"
-       "Add an expanded community-list entry\n"
        "Community list name\n")
 {
-  return community_list_unset_all_vty (vty, argv[1]);
+  return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
 }
 
-DEFUN (no_ip_community_list,
-       no_ip_community_list_cmd,
-       "no ip community-list WORD (deny|permit) .AA:NN",
+DEFUN (no_ip_community_list_name_expanded_all,
+       no_ip_community_list_name_expanded_all_cmd,
+       "no ip community-list expanded WORD",
        NO_STR
        IP_STR
        COMMUNITY_LIST_STR
-       "Community list name\n"
-       "Specify community to reject\n"
-       "Specify community to accept\n"
-       COMMUNITY_VAL_STR)
+       "Add an expanded community-list entry\n"
+       "Community list name\n")
 {
-  return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_AUTO);
+  return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
 }
 
 DEFUN (no_ip_community_list_standard,
@@ -9799,7 +9780,7 @@
 
 DEFUN (no_ip_community_list_expanded,
        no_ip_community_list_expanded_cmd,
-       "no ip community-list <100-199> (deny|permit) .LINE",
+       "no ip community-list <100-500> (deny|permit) .LINE",
        NO_STR
        IP_STR
        COMMUNITY_LIST_STR
@@ -9883,7 +9864,7 @@
   struct community_list *list;
   struct community_list_master *cm;
 
-  cm = community_list_master_lookup (bgp_clist, COMMUNITY_LIST_AUTO);
+  cm = community_list_master_lookup (bgp_clist, COMMUNITY_LIST_MASTER);
   if (! cm)
     return CMD_SUCCESS;
 
@@ -9898,7 +9879,7 @@
 
 DEFUN (show_ip_community_list_arg,
        show_ip_community_list_arg_cmd,
-       "show ip community-list (<1-199>|WORD)",
+       "show ip community-list (<1-500>|WORD)",
        SHOW_STR
        IP_STR
        "List community-list\n"
@@ -9907,7 +9888,7 @@
 {
   struct community_list *list;
 
-  list = community_list_lookup (bgp_clist, argv[0], COMMUNITY_LIST_AUTO);
+  list = community_list_lookup (bgp_clist, argv[0], COMMUNITY_LIST_MASTER);
   if (! list)
     {
       vty_out (vty, "%% Can't find communit-list%s", VTY_NEWLINE);
@@ -9968,49 +9949,38 @@
 }
 
 int
-extcommunity_list_unset_all_vty (struct vty *vty, const char *name)
+extcommunity_list_unset_vty (struct vty *vty, int argc, const char **argv,
+			     int style)
 {
   int ret;
+  int direct = 0;
+  char *str = NULL;
 
-  ret = extcommunity_list_unset (bgp_clist, name, NULL, 0, EXTCOMMUNITY_LIST_AUTO);
-
-  if (ret < 0)
+  if (argc > 1)
     {
-      community_list_perror (vty, ret);
-      return CMD_WARNING;
+      /* Check the list direct. */
+      if (strncmp (argv[1], "p", 1) == 0)
+	direct = COMMUNITY_PERMIT;
+      else if (strncmp (argv[1], "d", 1) == 0)
+	direct = COMMUNITY_DENY;
+      else
+	{
+	  vty_out (vty, "%% Matching condition must be permit or deny%s",
+		   VTY_NEWLINE);
+	  return CMD_WARNING;
+	}
+
+      /* Concat community string argument.  */
+      str = argv_concat (argv, argc, 2);
     }
-  return CMD_SUCCESS;
-}
-
-int
-extcommunity_list_unset_vty (struct vty *vty, int argc, const char **argv, 
-                             int style)
-{
-  int ret;
-  int direct;
-  char *str;
-
-  /* Check the list direct. */
-  if (strncmp (argv[1], "p", 1) == 0)
-    direct = COMMUNITY_PERMIT;
-  else if (strncmp (argv[1], "d", 1) == 0)
-    direct = COMMUNITY_DENY;
-  else
-    {
-      vty_out (vty, "%% Matching condition must be permit or deny%s",
-	       VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-
-  /* Concat community string argument.  */
-  str = argv_concat (argv, argc, 2);
 
   /* Unset community list.  */
   ret = extcommunity_list_unset (bgp_clist, argv[0], str, direct, style);
 
   /* Free temporary community list string allocated by
      argv_concat().  */
-  XFREE (MTYPE_TMP, str);
+  if (str)
+    XFREE (MTYPE_TMP, str);
 
   if (ret < 0)
     {
@@ -10049,7 +10019,7 @@
 
 DEFUN (ip_extcommunity_list_expanded,
        ip_extcommunity_list_expanded_cmd,
-       "ip extcommunity-list <100-199> (deny|permit) .LINE",
+       "ip extcommunity-list <100-500> (deny|permit) .LINE",
        IP_STR
        EXTCOMMUNITY_LIST_STR
        "Extended Community list number (expanded)\n"
@@ -10098,29 +10068,50 @@
   return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED, 1);
 }
 
-DEFUN (no_ip_extcommunity_list_all,
-       no_ip_extcommunity_list_all_cmd,
-       "no ip extcommunity-list (<1-99>|<100-199>)",
+DEFUN (no_ip_extcommunity_list_standard_all,
+       no_ip_extcommunity_list_standard_all_cmd,
+       "no ip extcommunity-list <1-99>",
        NO_STR
        IP_STR
        EXTCOMMUNITY_LIST_STR
-       "Extended Community list number (standard)\n"
-       "Extended Community list number (expanded)\n")
+       "Extended Community list number (standard)\n")
 {
-  return extcommunity_list_unset_all_vty (vty, argv[0]);
+  return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
 }
 
-DEFUN (no_ip_extcommunity_list_name_all,
-       no_ip_extcommunity_list_name_all_cmd,
-       "no ip extcommunity-list (standard|expanded) WORD",
+DEFUN (no_ip_extcommunity_list_expanded_all,
+       no_ip_extcommunity_list_expanded_all_cmd,
+       "no ip extcommunity-list <100-500>",
+       NO_STR
+       IP_STR
+       EXTCOMMUNITY_LIST_STR
+       "Extended Community list number (expanded)\n")
+{
+  return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
+}
+
+DEFUN (no_ip_extcommunity_list_name_standard_all,
+       no_ip_extcommunity_list_name_standard_all_cmd,
+       "no ip extcommunity-list standard WORD",
        NO_STR
        IP_STR
        EXTCOMMUNITY_LIST_STR
        "Specify standard extcommunity-list\n"
+       "Extended Community list name\n")
+{
+  return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
+}
+
+DEFUN (no_ip_extcommunity_list_name_expanded_all,
+       no_ip_extcommunity_list_name_expanded_all_cmd,
+       "no ip extcommunity-list expanded WORD",
+       NO_STR
+       IP_STR
+       EXTCOMMUNITY_LIST_STR
        "Specify expanded extcommunity-list\n"
        "Extended Community list name\n")
 {
-  return extcommunity_list_unset_all_vty (vty, argv[1]);
+  return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
 }
 
 DEFUN (no_ip_extcommunity_list_standard,
@@ -10139,7 +10130,7 @@
 
 DEFUN (no_ip_extcommunity_list_expanded,
        no_ip_extcommunity_list_expanded_cmd,
-       "no ip extcommunity-list <100-199> (deny|permit) .LINE",
+       "no ip extcommunity-list <100-500> (deny|permit) .LINE",
        NO_STR
        IP_STR
        EXTCOMMUNITY_LIST_STR
@@ -10223,7 +10214,7 @@
   struct community_list *list;
   struct community_list_master *cm;
 
-  cm = community_list_master_lookup (bgp_clist, EXTCOMMUNITY_LIST_AUTO);
+  cm = community_list_master_lookup (bgp_clist, EXTCOMMUNITY_LIST_MASTER);
   if (! cm)
     return CMD_SUCCESS;
 
@@ -10238,7 +10229,7 @@
 
 DEFUN (show_ip_extcommunity_list_arg,
        show_ip_extcommunity_list_arg_cmd,
-       "show ip extcommunity-list (<1-199>|WORD)",
+       "show ip extcommunity-list (<1-500>|WORD)",
        SHOW_STR
        IP_STR
        "List extended-community list\n"
@@ -10247,7 +10238,7 @@
 {
   struct community_list *list;
 
-  list = community_list_lookup (bgp_clist, argv[0], EXTCOMMUNITY_LIST_AUTO);
+  list = community_list_lookup (bgp_clist, argv[0], EXTCOMMUNITY_LIST_MASTER);
   if (! list)
     {
       vty_out (vty, "%% Can't find extcommunit-list%s", VTY_NEWLINE);
@@ -10287,23 +10278,15 @@
   int write = 0;
 
   /* Community-list.  */
-  cm = community_list_master_lookup (bgp_clist, COMMUNITY_LIST_AUTO);
+  cm = community_list_master_lookup (bgp_clist, COMMUNITY_LIST_MASTER);
 
   for (list = cm->num.head; list; list = list->next)
     for (entry = list->head; entry; entry = entry->next)
       {
-	if (atol (list->name) < 200)
-	  vty_out (vty, "ip community-list %s %s %s%s",
-		   list->name, community_direct_str (entry->direct),
-		   community_list_config_str (entry),
-		   VTY_NEWLINE);
-	else
-	  vty_out (vty, "ip community-list %s %s %s %s%s",
-		   entry->style == COMMUNITY_LIST_STANDARD
-		   ? "standard" : "expanded",
-		   list->name, community_direct_str (entry->direct),
-		   community_list_config_str (entry),
-		   VTY_NEWLINE);
+	vty_out (vty, "ip community-list %s %s %s%s",
+		 list->name, community_direct_str (entry->direct),
+		 community_list_config_str (entry),
+		 VTY_NEWLINE);
 	write++;
       }
   for (list = cm->str.head; list; list = list->next)
@@ -10319,21 +10302,14 @@
       }
 
   /* Extcommunity-list.  */
-  cm = community_list_master_lookup (bgp_clist, EXTCOMMUNITY_LIST_AUTO);
+  cm = community_list_master_lookup (bgp_clist, EXTCOMMUNITY_LIST_MASTER);
 
   for (list = cm->num.head; list; list = list->next)
     for (entry = list->head; entry; entry = entry->next)
       {
-	if (atol (list->name) < 200)
-	  vty_out (vty, "ip extcommunity-list %s %s %s%s",
-		   list->name, community_direct_str (entry->direct),
-		   community_list_config_str (entry), VTY_NEWLINE);
-	else
-	  vty_out (vty, "ip extcommunity-list %s %s %s %s%s",
-		   entry->style == EXTCOMMUNITY_LIST_STANDARD
-		   ? "standard" : "expanded",
-		   list->name, community_direct_str (entry->direct),
-		   community_list_config_str (entry), VTY_NEWLINE);
+	vty_out (vty, "ip extcommunity-list %s %s %s%s",
+		 list->name, community_direct_str (entry->direct),
+		 community_list_config_str (entry), VTY_NEWLINE);
 	write++;
       }
   for (list = cm->str.head; list; list = list->next)
@@ -10362,16 +10338,16 @@
   install_node (&community_list_node, community_list_config_write);
 
   /* Community-list.  */
-  install_element (CONFIG_NODE, &ip_community_list_cmd);
   install_element (CONFIG_NODE, &ip_community_list_standard_cmd);
   install_element (CONFIG_NODE, &ip_community_list_standard2_cmd);
   install_element (CONFIG_NODE, &ip_community_list_expanded_cmd);
   install_element (CONFIG_NODE, &ip_community_list_name_standard_cmd);
   install_element (CONFIG_NODE, &ip_community_list_name_standard2_cmd);
   install_element (CONFIG_NODE, &ip_community_list_name_expanded_cmd);
-  install_element (CONFIG_NODE, &no_ip_community_list_all_cmd);
-  install_element (CONFIG_NODE, &no_ip_community_list_name_all_cmd);
-  install_element (CONFIG_NODE, &no_ip_community_list_cmd);
+  install_element (CONFIG_NODE, &no_ip_community_list_standard_all_cmd);
+  install_element (CONFIG_NODE, &no_ip_community_list_expanded_all_cmd);
+  install_element (CONFIG_NODE, &no_ip_community_list_name_standard_all_cmd);
+  install_element (CONFIG_NODE, &no_ip_community_list_name_expanded_all_cmd);
   install_element (CONFIG_NODE, &no_ip_community_list_standard_cmd);
   install_element (CONFIG_NODE, &no_ip_community_list_expanded_cmd);
   install_element (CONFIG_NODE, &no_ip_community_list_name_standard_cmd);
@@ -10388,8 +10364,10 @@
   install_element (CONFIG_NODE, &ip_extcommunity_list_name_standard_cmd);
   install_element (CONFIG_NODE, &ip_extcommunity_list_name_standard2_cmd);
   install_element (CONFIG_NODE, &ip_extcommunity_list_name_expanded_cmd);
-  install_element (CONFIG_NODE, &no_ip_extcommunity_list_all_cmd);
-  install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_all_cmd);
+  install_element (CONFIG_NODE, &no_ip_extcommunity_list_standard_all_cmd);
+  install_element (CONFIG_NODE, &no_ip_extcommunity_list_expanded_all_cmd);
+  install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_standard_all_cmd);
+  install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_expanded_all_cmd);
   install_element (CONFIG_NODE, &no_ip_extcommunity_list_standard_cmd);
   install_element (CONFIG_NODE, &no_ip_extcommunity_list_expanded_cmd);
   install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_standard_cmd);
