From 96d7651ad3ac766dbec3f9d8a7b3e0f9676a20ee Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Tue, 22 May 2007 14:03:32 +0000 Subject: Only try to merge a AS_SEQUENCE if there is a difference between the 4-byte AS path and the 2-byte version. If both pathes have the same length don't try to merge them instead use the new path. Issue reported by Jon Morby and further analysed by Stuart Henderson. Tested by Stuart Henderson. --- usr.sbin/bgpd/rde_attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c index 2f1d5132d34..54730c0077d 100644 --- a/usr.sbin/bgpd/rde_attr.c +++ b/usr.sbin/bgpd/rde_attr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_attr.c,v 1.74 2007/05/11 11:27:59 claudio Exp $ */ +/* $OpenBSD: rde_attr.c,v 1.75 2007/05/22 14:03:31 claudio Exp $ */ /* * Copyright (c) 2004 Claudio Jeker @@ -594,7 +594,7 @@ aspath_merge(struct rde_aspath *a, struct attr *attr) } diff = a->aspath->ascnt - ascnt; - if (attr->len > 2 && attr->data[0] == AS_SEQUENCE) + if (diff && attr->len > 2 && attr->data[0] == AS_SEQUENCE) hroom = attr->data[1]; difflen = aspath_countlength(a->aspath, diff, hroom); nlen = attr->len + difflen; -- cgit v1.2.3