summaryrefslogtreecommitdiffstats
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2008-10-26 22:45:09 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2008-10-26 22:45:09 +0100
commit4847a894bf7d4852325c3f1ea4bb4890054a1f66 (patch)
tree46d0f400b9e6fc3dfaf64d7058c473e44501ddc1 /proto/bgp/bgp.c
parentd51aa2819005a03e4cfb6f62333be6ccadfb3c06 (diff)
downloadbird-4847a894bf7d4852325c3f1ea4bb4890054a1f66.tar
bird-4847a894bf7d4852325c3f1ea4bb4890054a1f66.zip
Implementation of route reflection for BGP
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index e1f5ec0..5fa1249 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -485,6 +485,13 @@ bgp_start_locked(struct object_lock *lock)
p->local_id = cf->c.global->router_id;
p->next_hop = cf->multihop ? cf->multihop_via : cf->remote_ip;
p->neigh = neigh_find(&p->p, &p->next_hop, NEF_STICKY);
+
+ if (cf->rr_client)
+ {
+ p->rr_cluster_id = cf->rr_cluster_id ? cf->rr_cluster_id : p->local_id;
+ p->rr_client = cf->rr_client;
+ }
+
if (!p->neigh)
{
log(L_ERR "%s: Invalid next hop %I", p->p.name, p->next_hop);
@@ -633,6 +640,8 @@ bgp_check(struct bgp_config *c)
cf_error("Local AS number out of range");
if (!bgp_as4_support && (c->remote_as > 0xFFFF))
cf_error("Neighbor AS number out of range");
+ if ((c->local_as != c->remote_as) && (c->rr_client))
+ cf_error("Only internal neighbor can be RR client");
}
static void