summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_aspath.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 03:29:18 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 03:29:18 +0200
commit2a3fa5d7c4cc59be995c1767870ac70403730da2 (patch)
treee1d52b0132a2db6066df1b0ff4bbeb8f9caa00e3 /bgpd/bgp_aspath.c
parentThe BGP cli needs support for soft clearing swpX peers (diff)
downloadfrr-2a3fa5d7c4cc59be995c1767870ac70403730da2.tar.xz
frr-2a3fa5d7c4cc59be995c1767870ac70403730da2.zip
AS_PATH comparison is broken if CONFED_AS_SEQ are present
Diffstat (limited to 'bgpd/bgp_aspath.c')
-rw-r--r--bgpd/bgp_aspath.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index e46857c32..8829cf0ce 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -1567,13 +1567,13 @@ aspath_cmp_left (const struct aspath *aspath1, const struct aspath *aspath2)
if (!(aspath1 && aspath2))
return 0;
- /* If both paths are originated in this AS then we do want to compare MED */
- if (!aspath_count_hops(aspath1) && !aspath_count_hops(aspath2))
- return 1;
-
seg1 = aspath1->segments;
seg2 = aspath2->segments;
+ /* If both paths are originated in this AS then we do want to compare MED */
+ if (!seg1 && !seg2)
+ return 1;
+
/* find first non-confed segments for each */
while (seg1 && ((seg1->type == AS_CONFED_SEQUENCE)
|| (seg1->type == AS_CONFED_SET)))