diff options
| author | paul <paul> | 2003-06-09 18:48:31 +0000 | 
|---|---|---|
| committer | paul <paul> | 2003-06-09 18:48:31 +0000 | 
| commit | 847375b9ea6facadba6517d50bfb9ade4bf65242 (patch) | |
| tree | f4ae6f43a571e543c3f5bf42d7b8d2e6dc27fa67 /bgpd | |
| parent | 01d0908a17fcaefa9cf4e8379765ed79dba07db5 (diff) | |
2003-06-09 Paul Jakma <paul@dishone.st>
        * bgp_clist.c (community_list_delete): honour deny statements
Diffstat (limited to 'bgpd')
| -rw-r--r-- | bgpd/bgp_clist.c | 31 | 
1 files changed, 21 insertions, 10 deletions
| diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c index 3cf1d2ea..a2c12100 100644 --- a/bgpd/bgp_clist.c +++ b/bgpd/bgp_clist.c @@ -524,25 +524,36 @@ community_list_match_delete (struct community *com,    for (entry = list->head; entry; entry = entry->next)      { -      if (entry->any && entry->direct == COMMUNITY_PERMIT) +      if (entry->any)          { -          /* This is a tricky part.  Currently only -             route_set_community_delete() uses this function.  In the -             function com->size is zero, it free the community -             structure.  */ -          com->size = 0; +          if (entry->direct == COMMUNITY_PERMIT)  +            { +              /* This is a tricky part.  Currently only +               * route_set_community_delete() uses this function.  In the +               * function com->size is zero, it free the community +               * structure.   +               */ +              com->size = 0; +            }            return com;          } -      if (entry->style == COMMUNITY_LIST_STANDARD) +      if ((entry->style == COMMUNITY_LIST_STANDARD)  +          && (community_include (entry->u.com, COMMUNITY_INTERNET) +              || community_match (com, entry->u.com) ))          { -          if (entry->direct == COMMUNITY_PERMIT) -            community_delete (com, entry->u.com); +              if (entry->direct == COMMUNITY_PERMIT) +                community_delete (com, entry->u.com); +              else +                break;          } -      else if (entry->style == COMMUNITY_LIST_EXPANDED) +      else if ((entry->style == COMMUNITY_LIST_EXPANDED) +               && community_regexp_match (com, entry->reg))          {            if (entry->direct == COMMUNITY_PERMIT)              community_regexp_delete (com, entry->reg); +          else +            break;          }      }    return com; | 
