summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nest/proto.c16
-rw-r--r--proto/bgp/bgp.c7
2 files changed, 18 insertions, 5 deletions
diff --git a/nest/proto.c b/nest/proto.c
index d6d5d77..f04b5a6 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -31,6 +31,7 @@ list active_proto_list;
static list inactive_proto_list;
static list initial_proto_list;
static list flush_proto_list;
+static struct proto *initial_device_proto;
static event *proto_flush_event;
@@ -248,6 +249,8 @@ protos_postconfig(struct config *c)
DBG("\n");
}
+extern struct protocol proto_unix_iface;
+
static struct proto *
proto_init(struct proto_config *c)
{
@@ -257,6 +260,9 @@ proto_init(struct proto_config *c)
q->proto_state = PS_DOWN;
q->core_state = FS_HUNGRY;
proto_enqueue(&initial_proto_list, q);
+ if (p == &proto_unix_iface)
+ initial_device_proto = q;
+
add_tail(&proto_list, &q->glob_node);
PD(q, "Initializing%s", q->disabled ? " [disabled]" : "");
return q;
@@ -413,6 +419,14 @@ protos_commit(struct config *new, struct config *old, int force_reconfig, int ty
DBG("\tdone\n");
DBG("Protocol start\n");
+
+ /* Start device protocol first */
+ if (initial_device_proto)
+ {
+ proto_rethink_goal(initial_device_proto);
+ initial_device_proto = NULL;
+ }
+
WALK_LIST_DELSAFE(p, n, initial_proto_list)
proto_rethink_goal(p);
}
@@ -741,8 +755,6 @@ proto_notify_state(struct proto *p, unsigned ps)
}
}
-extern struct protocol proto_unix_iface;
-
static void
proto_flush_all(void *unused UNUSED)
{
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 327292a..9c069b4 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -798,6 +798,10 @@ bgp_start(struct proto *P)
p->startup_timer->hook = bgp_startup_timeout;
p->startup_timer->data = p;
+ p->local_id = proto_get_router_id(P->cf);
+ if (p->rr_client)
+ p->rr_cluster_id = p->cf->rr_cluster_id ? p->cf->rr_cluster_id : p->local_id;
+
p->remote_id = 0;
p->source_addr = p->cf->source_addr;
@@ -874,11 +878,8 @@ bgp_init(struct proto_config *C)
p->local_as = c->local_as;
p->remote_as = c->remote_as;
p->is_internal = (c->local_as == c->remote_as);
- p->local_id = proto_get_router_id(C);
p->rs_client = c->rs_client;
p->rr_client = c->rr_client;
- if (p->rr_client)
- p->rr_cluster_id = c->rr_cluster_id ? c->rr_cluster_id : p->local_id;
p->igp_table = get_igp_table(c);
return P;