summaryrefslogtreecommitdiff
path: root/nest/proto.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2012-12-27 12:56:23 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2012-12-27 12:56:23 +0100
commit79b4e12e6032faf6bb1f3feac385bd36ee53019e (patch)
tree0509f66417bbaf3429594ac7c359971d75b3ec49 /nest/proto.c
parenta92cf57dd6ba021a495fe7268c86dc8e6aeecbb2 (diff)
Implements interface masks for choosing router id.
Router ID could be automatically determined based of subset of ifaces/addresses specified by 'router id from' option. The patch also does some minor changes related to router ID reconfiguration. Thanks to Alexander V. Chernikov for most of the work.
Diffstat (limited to 'nest/proto.c')
-rw-r--r--nest/proto.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 1334884e..b976a6cb 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -382,11 +382,9 @@ proto_reconfigure(struct proto *p, struct proto_config *oc, struct proto_config
/* If there is a too big change in core attributes, ... */
if ((nc->protocol != oc->protocol) ||
(nc->disabled != p->disabled) ||
- (nc->table->table != oc->table->table) ||
- (proto_get_router_id(nc) != proto_get_router_id(oc)))
+ (nc->table->table != oc->table->table))
return 0;
-
p->debug = nc->debug;
p->mrtdump = nc->mrtdump;
proto_reconfig_type = type;
@@ -552,6 +550,16 @@ protos_commit(struct config *new, struct config *old, int force_reconfig, int ty
initial_device_proto = NULL;
}
+ /* Determine router ID for the first time - it has to be here and not in
+ global_commit() because it is postponed after start of device protocol */
+ if (!config->router_id)
+ {
+ config->router_id = if_choose_router_id(config->router_id_from, 0);
+ if (!config->router_id)
+ die("Cannot determine router ID, please configure it manually");
+ }
+
+ /* Start all other protocols */
WALK_LIST_DELSAFE(p, n, initial_proto_list)
proto_rethink_goal(p);
}