summaryrefslogtreecommitdiff
path: root/bgpd/bgp_aspath.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_aspath.c')
-rw-r--r--bgpd/bgp_aspath.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index 2e2248cd72..fc13085437 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -1703,7 +1703,7 @@ struct aspath *aspath_filter_exclude_acl(struct aspath *source,
if (cur_seg == source->segments)
/* first segment */
source->segments = cur_seg->next;
- else
+ else if (prev_seg)
prev_seg->next = cur_seg->next;
assegment_free(cur_seg);
}
@@ -1725,8 +1725,9 @@ struct aspath *aspath_filter_exclude_acl(struct aspath *source,
else if (prev_seg)
prev_seg->next = new_seg;
assegment_free(cur_seg);
- }
- prev_seg = cur_seg;
+ prev_seg = new_seg;
+ } else
+ prev_seg = cur_seg;
cur_seg = next_seg;
}