summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-05-22 14:03:32 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-05-22 14:03:32 +0000
commit96d7651ad3ac766dbec3f9d8a7b3e0f9676a20ee (patch)
tree14059ceea9f9a73376d51dfe645687e5c9ff9192
parentfb032318a854417c2370bccb0b24789112055093 (diff)
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.
-rw-r--r--usr.sbin/bgpd/rde_attr.c4
1 files 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 <claudio@openbsd.org>
@@ -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;