summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_clist.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c
index 7104f17e5e..162ea59a06 100644
--- a/bgpd/bgp_clist.c
+++ b/bgpd/bgp_clist.c
@@ -941,9 +941,8 @@ struct lcommunity *lcommunity_list_match_delete(struct lcommunity *lcom,
}
/* Delete all of the communities we flagged for deletion */
- ptr = lcom->val;
for (i = delete_index - 1; i >= 0; i--) {
- ptr += (com_index_to_delete[i] * LCOMMUNITY_SIZE);
+ ptr = lcom->val + (com_index_to_delete[i] * LCOMMUNITY_SIZE);
lcommunity_del_val(lcom, ptr);
}