]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_clist.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / bgpd / bgp_clist.c
index 0e590a463c90c5ece4f80bbbc05613fbfc1784c9..1d2ba3bf5845eff39742cd91bff8670c8b5545d9 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP community-list and extcommunity-list.
  * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -184,7 +169,7 @@ community_list_insert(struct community_list_handler *ch, const char *name,
        new->name_hash = bgp_clist_hash_key_community_list(new);
 
        /* Save for later */
-       hash_get(cm->hash, new, hash_alloc_intern);
+       (void)hash_get(cm->hash, new, hash_alloc_intern);
 
        /* If name is made by all digit character.  We treat it as
           number. */
@@ -464,8 +449,12 @@ static char *community_str_get(struct community *com, int i)
        comval = ntohl(comval);
 
        switch (comval) {
+#if CONFDATE > 20230801
+CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
+#endif
        case COMMUNITY_INTERNET:
                str = XSTRDUP(MTYPE_COMMUNITY_STR, "internet");
+               zlog_warn("`internet` community is deprecated");
                break;
        case COMMUNITY_GSHUT:
                str = XSTRDUP(MTYPE_COMMUNITY_STR, "graceful-shutdown");
@@ -557,7 +546,7 @@ static bool community_regexp_match(struct community *com, regex_t *reg)
        if (com == NULL || com->size == 0)
                str = "";
        else
-               str = community_str(com, false);
+               str = community_str(com, false, true);
 
        regstr = bgp_alias2community_str(str);
 
@@ -631,7 +620,7 @@ static bool lcommunity_regexp_match(struct lcommunity *com, regex_t *reg)
        if (com == NULL || com->size == 0)
                str = "";
        else
-               str = lcommunity_str(com, false);
+               str = lcommunity_str(com, false, true);
 
        regstr = bgp_alias2community_str(str);