summaryrefslogtreecommitdiff
path: root/bgpd
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 /bgpd
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 'bgpd')
-rw-r--r--bgpd/ChangeLog6
-rw-r--r--bgpd/bgp_aspath.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index 90d0e0e3..99960aef 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -1,3 +1,9 @@
+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].
+
2006-07-27 Paul Jakma <paul.jakma@sun.com>
* bgpd.c: (peer_delete) Ensure freed buffers can not be
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index d404309c..317e9f8d 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -926,14 +926,14 @@ aspath_firstas_check (struct aspath *aspath, as_t asno)
return 0;
}
-/* AS path loop check. If aspath contains asno then return 1. */
+/* AS path loop check. If aspath contains asno then return >= 1. */
int
aspath_loop_check (struct aspath *aspath, as_t asno)
{
struct assegment *seg;
int count = 0;
- if ( (aspath == NULL) || (aspath->segments) )
+ if ( (aspath == NULL) || (aspath->segments == NULL) )
return 0;
seg = aspath->segments;
@@ -1363,7 +1363,7 @@ aspath_str2aspath (const char *str)
{
enum as_token token = as_token_unknown;
u_short as_type;
- u_short asno = NULL;
+ u_short asno = 0;
struct aspath *aspath;
int needtype;