diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2009-10-12 20:44:58 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2009-10-12 20:44:58 +0200 |
commit | 52b9b2a1786140c38af03de570b0cc96c835c1d3 (patch) | |
tree | a19f18654f2ef3aed6d9d369258e9e8d693474f8 /nest/a-path.c | |
parent | ea89da381fc682155e7d08d6ad3d4ac8aa5fe115 (diff) | |
download | bird-52b9b2a1786140c38af03de570b0cc96c835c1d3.tar bird-52b9b2a1786140c38af03de570b0cc96c835c1d3.zip |
Rename as_path_get_last/as_path_get_first to be consistent.
Diffstat (limited to 'nest/a-path.c')
-rw-r--r-- | nest/a-path.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nest/a-path.c b/nest/a-path.c index 19d61f0..c804619 100644 --- a/nest/a-path.c +++ b/nest/a-path.c @@ -213,7 +213,7 @@ as_path_getlen_int(struct adata *path, int bs) } int -as_path_get_first(struct adata *path, u32 *orig_as) +as_path_get_last(struct adata *path, u32 *orig_as) { int bs = bgp_as4_support ? 4 : 2; int found = 0; @@ -229,8 +229,7 @@ as_path_get_first(struct adata *path, u32 *orig_as) case AS_PATH_SET: if (len = *p++) { - found = 1; - res = get_as(p); + found = 0; p += bs * len; } break; @@ -246,12 +245,13 @@ as_path_get_first(struct adata *path, u32 *orig_as) } } - *orig_as = res; + if (found) + *orig_as = res; return found; } int -as_path_get_last(struct adata *path, u32 *last_as) +as_path_get_first(struct adata *path, u32 *last_as) { u8 *p = path->data; |