From 52b9b2a1786140c38af03de570b0cc96c835c1d3 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 12 Oct 2009 20:44:58 +0200 Subject: Rename as_path_get_last/as_path_get_first to be consistent. --- nest/a-path.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nest/a-path.c') 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; -- cgit v1.2.3