summaryrefslogtreecommitdiff
path: root/proto/bgp/attrs.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2013-10-21 14:58:32 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2013-10-21 14:59:35 +0200
commita15dab76f93337b07b4b03a64ac3bac26285dfd9 (patch)
treeef2593148938733814a8b4b1a6fceb60e5c30886 /proto/bgp/attrs.c
parentf8cc7396cf25328b002394bbd7af679188b03370 (diff)
Implements 'allow local as' option.
Similar to allowas-in option on other routers.
Diffstat (limited to 'proto/bgp/attrs.c')
-rw-r--r--proto/bgp/attrs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index c27a4988..8e25c4d2 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -950,8 +950,9 @@ bgp_create_attrs(struct bgp_proto *p, rte *e, ea_list **attrs, struct linpool *p
static inline int
bgp_as_path_loopy(struct bgp_proto *p, rta *a)
{
+ int num = p->cf->allow_local_as + 1;
eattr *e = ea_find(a->eattrs, EA_CODE(EAP_BGP, BA_AS_PATH));
- return (e && as_path_is_member(e->u.ptr, p->local_as));
+ return (e && (num > 0) && as_path_contains(e->u.ptr, p->local_as, num));
}
static inline int