]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes bug related to AS2->AS4 conversion.
authorOndrej Zajicek <santiago@crfreenet.org>
Tue, 25 Aug 2009 17:01:37 +0000 (19:01 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 25 Aug 2009 17:01:37 +0000 (19:01 +0200)
nest/a-path.c
nest/attrs.h
proto/bgp/attrs.c

index dba214d21bed6522e2dd29c67f1412bf20e17e9b..0a4bf829291cc3ce02cdd1346345539f0f61025d 100644 (file)
@@ -188,6 +188,12 @@ int
 as_path_getlen(struct adata *path)
 {
   int bs = bgp_as4_support ? 4 : 2;
+  return as_path_getlen_int(path, bs);
+}
+
+int
+as_path_getlen_int(struct adata *path, int bs)
+{
   int res = 0;
   u8 *p = path->data;
   u8 *q = p+path->length;
index b838ce96799f67fcb86879b63d564a2d809e09c9..eee6b37871ac86ffb69522fc4cebd265543eacd5 100644 (file)
@@ -28,6 +28,7 @@ int as_path_convert_to_old(struct adata *path, byte *dst, int *new_used);
 int as_path_convert_to_new(struct adata *path, byte *dst, int req_as);
 void as_path_format(struct adata *path, byte *buf, unsigned int size);
 int as_path_getlen(struct adata *path);
+int as_path_getlen_int(struct adata *path, int bs);
 int as_path_get_first(struct adata *path, u32 *orig_as);
 int as_path_get_last(struct adata *path, u32 *last_as);
 int as_path_is_member(struct adata *path, u32 as);
index 68f21b97c75b9868c8a17525eb70cd6397ceda4a..bf976a6e2528084523c7010d9033e48f772b425b 100644 (file)
@@ -1189,7 +1189,7 @@ bgp_reconstruct_4b_atts(struct bgp_proto *p, rta *a, struct linpool *pool)
     if (a4)
       log(L_WARN "%s: AS4_AGGREGATOR attribute received, but AGGREGATOR attribute is missing", p->p.name);
 
-  int p2_len = as_path_getlen(p2->u.ptr);
+  int p2_len = as_path_getlen_int(p2->u.ptr, 2);
   int p4_len = p4 ? validate_as4_path(p, p4->u.ptr) : -1;
 
   if (p4 && (p4_len < 0))