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 162ea59a06..48fc8474db 100644
--- a/bgpd/bgp_clist.c
+++ b/bgpd/bgp_clist.c
@@ -907,9 +907,8 @@ struct lcommunity *lcommunity_list_match_delete(struct lcommunity *lcom,
* community-list. If we need to delete a community value add its index
* to com_index_to_delete.
*/
- ptr = lcom->val;
for (i = 0; i < lcom->size; i++) {
- ptr += (i * LCOMMUNITY_SIZE);
+ ptr = lcom->val + (i * LCOMMUNITY_SIZE);
for (entry = list->head; entry; entry = entry->next) {
if (entry->any) {
if (entry->direct == COMMUNITY_PERMIT) {