summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-08-06 15:52:11 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-08-06 15:52:11 +0000
commit1f742f21a98f756cea03856849fa2f82f467baf7 (patch)
treefe295616ed2036e691cf85f7fd73083ad4ddc2fd /tests
parent36943749147bef10df8ffc0e2ad79f4dd06cd9ac (diff)
[bgpd] aspath_loop_check was broken, fix it and the aspath unit test code.
2006-08-06 Paul Jakma <paul.jakma@sun.com> * bgp_aspath.c: (aspath_loop_check) Fix the typo-bug which essentially had disabled this check. Problem reported by Bartek Kania <mrbk@gnarf.org> in [quagga-users 7388]. * aspath_test.c: (validate) Fix the sense of the aspath_loop_check, which was the wrong way around and had actually been testing for aspath_loop_check to be buggy.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog6
-rw-r--r--tests/aspath_test.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 74118e63..b066cfd8 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,9 @@
+2006-08-06 Paul Jakma <paul.jakma@sun.com>
+
+ * aspath_test.c: (validate) Fix the sense of the aspath_loop_check,
+ which was the wrong way around and had actually been testing for
+ aspath_loop_check to be buggy.
+
2006-05-28 Paul Jakma <paul.jakma@sun.com>
* test-sig.c: (main) configure logging, there's no terminal
diff --git a/tests/aspath_test.c b/tests/aspath_test.c
index 5d510cca..1d28dbed 100644
--- a/tests/aspath_test.c
+++ b/tests/aspath_test.c
@@ -76,7 +76,7 @@ static struct test_segment {
10,
{ "8482 51457 {5204}",
"8482 51457 {5204}",
- 3, 0, NOT_ALL_PRIVATE, 5204, 51457, 8482},
+ 3, 0, NOT_ALL_PRIVATE, 5204, 51456, 8482},
},
{ /* 4 */
"seqset2",
@@ -618,8 +618,8 @@ validate (struct aspath *as, const struct test_spec *sp)
}
/* loop, private and first as checks */
- if (aspath_loop_check (as, sp->does_loop)
- || aspath_loop_check (as, sp->doesnt_loop)
+ if ((sp->does_loop && aspath_loop_check (as, sp->does_loop) == 0)
+ || (sp->doesnt_loop && aspath_loop_check (as, sp->doesnt_loop) != 0)
|| (aspath_private_as_check (as) != sp->private_as)
|| (aspath_firstas_check (as,sp->first)
&& sp->first == 0))