Skip to content

Commit b2b47bb

Browse files
committed
bgpd: Remove deprecated COMMUNITY_INTERNET community
Signed-off-by: Donatas Abraitis <[email protected]>
1 parent 7415f1e commit b2b47bb

File tree

4 files changed

+2
-62
lines changed

4 files changed

+2
-62
lines changed

bgpd/bgp_clist.c

+2-18
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,6 @@ static char *community_str_get(struct community *com, int i)
449449
comval = ntohl(comval);
450450

451451
switch (comval) {
452-
#if CONFDATE > 20230801
453-
CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
454-
#endif
455-
case COMMUNITY_INTERNET:
456-
str = XSTRDUP(MTYPE_COMMUNITY_STR, "internet");
457-
zlog_warn("`internet` community is deprecated");
458-
break;
459452
case COMMUNITY_GSHUT:
460453
str = XSTRDUP(MTYPE_COMMUNITY_STR, "graceful-shutdown");
461454
break;
@@ -660,9 +653,6 @@ bool community_list_match(struct community *com, struct community_list *list)
660653

661654
for (entry = list->head; entry; entry = entry->next) {
662655
if (entry->style == COMMUNITY_LIST_STANDARD) {
663-
if (community_include(entry->u.com, COMMUNITY_INTERNET))
664-
return entry->direct == COMMUNITY_PERMIT;
665-
666656
if (community_match(com, entry->u.com))
667657
return entry->direct == COMMUNITY_PERMIT;
668658
} else if (entry->style == COMMUNITY_LIST_EXPANDED) {
@@ -735,9 +725,6 @@ bool community_list_exact_match(struct community *com,
735725

736726
for (entry = list->head; entry; entry = entry->next) {
737727
if (entry->style == COMMUNITY_LIST_STANDARD) {
738-
if (community_include(entry->u.com, COMMUNITY_INTERNET))
739-
return entry->direct == COMMUNITY_PERMIT;
740-
741728
if (community_cmp(com, entry->u.com))
742729
return entry->direct == COMMUNITY_PERMIT;
743730
} else if (entry->style == COMMUNITY_LIST_EXPANDED) {
@@ -767,17 +754,14 @@ struct community *community_list_match_delete(struct community *com,
767754

768755
for (entry = list->head; entry; entry = entry->next) {
769756
if ((entry->style == COMMUNITY_LIST_STANDARD) &&
770-
(community_include(entry->u.com,
771-
COMMUNITY_INTERNET) ||
772-
community_include(entry->u.com, val))) {
757+
community_include(entry->u.com, val)) {
773758
if (entry->direct == COMMUNITY_PERMIT) {
774759
com_index_to_delete[delete_index] = i;
775760
delete_index++;
776761
}
777762
break;
778763
} else if ((entry->style == COMMUNITY_LIST_EXPANDED) &&
779-
community_regexp_include(entry->reg, com,
780-
i)) {
764+
community_regexp_include(entry->reg, com, i)) {
781765
if (entry->direct == COMMUNITY_PERMIT) {
782766
com_index_to_delete[delete_index] = i;
783767
delete_index++;

bgpd/bgp_community.c

-30
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,6 @@ static void set_community_string(struct community *com, bool make_json,
228228
comval = ntohl(comval);
229229

230230
switch (comval) {
231-
#if CONFDATE > 20230801
232-
CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
233-
#endif
234-
case COMMUNITY_INTERNET:
235-
len += strlen(" internet");
236-
zlog_warn("`internet` community is deprecated");
237-
break;
238231
case COMMUNITY_GSHUT:
239232
len += strlen(" graceful-shutdown");
240233
break;
@@ -298,19 +291,6 @@ CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
298291
strlcat(str, " ", len);
299292

300293
switch (comval) {
301-
#if CONFDATE > 20230801
302-
CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
303-
#endif
304-
case COMMUNITY_INTERNET:
305-
strlcat(str, "internet", len);
306-
if (make_json) {
307-
json_string =
308-
json_object_new_string("internet");
309-
json_object_array_add(json_community_list,
310-
json_string);
311-
}
312-
zlog_warn("`internet` community is deprecated");
313-
break;
314294
case COMMUNITY_GSHUT:
315295
strlcat(str, "graceful-shutdown", len);
316296
if (make_json) {
@@ -680,16 +660,6 @@ community_gettoken(const char *buf, enum community_token *token, uint32_t *val)
680660

681661
/* Well known community string check. */
682662
if (isalpha((unsigned char)*p)) {
683-
#if CONFDATE > 20230801
684-
CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
685-
#endif
686-
if (strncmp(p, "internet", strlen("internet")) == 0) {
687-
*val = COMMUNITY_INTERNET;
688-
*token = community_token_no_export;
689-
p += strlen("internet");
690-
zlog_warn("`internet` community is deprecated");
691-
return p;
692-
}
693663
if (strncmp(p, "graceful-shutdown", strlen("graceful-shutdown"))
694664
== 0) {
695665
*val = COMMUNITY_GSHUT;

bgpd/bgp_community.h

-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ struct community {
3030
};
3131

3232
/* Well-known communities value. */
33-
#if CONFDATE > 20230801
34-
CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
35-
#endif
36-
#define COMMUNITY_INTERNET 0x0
3733
#define COMMUNITY_GSHUT 0xFFFF0000
3834
#define COMMUNITY_ACCEPT_OWN 0xFFFF0001
3935
#define COMMUNITY_ROUTE_FILTER_TRANSLATED_v4 0xFFFF0002

bgpd/bgp_routemap.c

-10
Original file line numberDiff line numberDiff line change
@@ -6282,16 +6282,6 @@ DEFUN_YANG (set_community,
62826282
else
62836283
first = 1;
62846284

6285-
#if CONFDATE > 20230801
6286-
CPP_NOTICE("Deprecate COMMUNITY_INTERNET BGP community")
6287-
#endif
6288-
if (strncmp(argv[i]->arg, "internet", strlen(argv[i]->arg))
6289-
== 0) {
6290-
buffer_putstr(b, "internet");
6291-
vty_out(vty, "%% `internet` community is deprecated\n");
6292-
zlog_warn("`internet` community is deprecated");
6293-
continue;
6294-
}
62956285
if (strncmp(argv[i]->arg, "local-AS", strlen(argv[i]->arg))
62966286
== 0) {
62976287
buffer_putstr(b, "local-AS");

0 commit comments

Comments
 (0)