Skip to content

Commit 182263b

Browse files
authored
Merge pull request #22151 from mjstapp/fix_rmap_comm_del
bgpd: remove unneeded sort of communities in rmap delete
2 parents 9bf889b + a603e0f commit 182263b

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

bgpd/bgp_routemap.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3041,7 +3041,6 @@ static enum route_map_cmd_result_t
30413041
route_set_lcommunity_delete(void *rule, const struct prefix *pfx, void *object)
30423042
{
30433043
struct community_list *list;
3044-
struct lcommunity *merge;
30453044
struct lcommunity *new;
30463045
struct lcommunity *old;
30473046
struct bgp_path_info *path;
@@ -3056,9 +3055,7 @@ route_set_lcommunity_delete(void *rule, const struct prefix *pfx, void *object)
30563055
old = bgp_attr_get_lcommunity(path->attr);
30573056

30583057
if (list && old) {
3059-
merge = lcommunity_list_match_delete(lcommunity_dup(old), list);
3060-
new = lcommunity_uniq_sort(merge);
3061-
lcommunity_free(&merge);
3058+
new = lcommunity_list_match_delete(lcommunity_dup(old), list);
30623059

30633060
/* HACK: if the old community is not intern'd,
30643061
* we should free it here, or all reference to it may be
@@ -3128,7 +3125,6 @@ route_set_community_delete(void *rule, const struct prefix *prefix,
31283125
void *object)
31293126
{
31303127
struct community_list *list;
3131-
struct community *merge;
31323128
struct community *new;
31333129
struct community *old;
31343130
struct bgp_path_info *path;
@@ -3143,9 +3139,7 @@ route_set_community_delete(void *rule, const struct prefix *prefix,
31433139
old = bgp_attr_get_community(path->attr);
31443140

31453141
if (list && old) {
3146-
merge = community_list_match_delete(community_dup(old), list);
3147-
new = community_uniq_sort(merge);
3148-
community_free(&merge);
3142+
new = community_list_match_delete(community_dup(old), list);
31493143

31503144
/* HACK: if the old community is not intern'd,
31513145
* we should free it here, or all reference to it may be
@@ -3212,7 +3206,6 @@ route_set_ecommunity_delete(void *rule, const struct prefix *prefix,
32123206
void *object)
32133207
{
32143208
struct community_list *list;
3215-
struct ecommunity *merge;
32163209
struct ecommunity *new;
32173210
struct ecommunity *old;
32183211
struct bgp_path_info *path;
@@ -3226,9 +3219,7 @@ route_set_ecommunity_delete(void *rule, const struct prefix *prefix,
32263219
EXTCOMMUNITY_LIST_MASTER);
32273220
old = bgp_attr_get_ecommunity(path->attr);
32283221
if (list && old) {
3229-
merge = ecommunity_list_match_delete(ecommunity_dup(old), list);
3230-
new = ecommunity_uniq_sort(merge);
3231-
ecommunity_free(&merge);
3222+
new = ecommunity_list_match_delete(ecommunity_dup(old), list);
32323223

32333224
/* HACK: if the old community is not intern'd,
32343225
* we should free it here, or all reference to it may be

0 commit comments

Comments
 (0)