diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2012-12-27 12:56:23 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2012-12-27 12:56:23 +0100 |
commit | 79b4e12e6032faf6bb1f3feac385bd36ee53019e (patch) | |
tree | 0509f66417bbaf3429594ac7c359971d75b3ec49 /conf/conf.c | |
parent | a92cf57dd6ba021a495fe7268c86dc8e6aeecbb2 (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 'conf/conf.c')
-rw-r--r-- | conf/conf.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/conf/conf.c b/conf/conf.c index 6dfa3691..14225d3b 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -200,9 +200,19 @@ global_commit(struct config *new, struct config *old) log(L_WARN "Reconfiguration of BGP listening socket not implemented, please restart BIRD."); if (!new->router_id) - new->router_id = old->router_id; - if (new->router_id != old->router_id) - return 1; + { + new->router_id = old->router_id; + + if (new->router_id_from) + { + u32 id = if_choose_router_id(new->router_id_from, old->router_id); + if (!id) + log(L_WARN "Cannot determine router ID, using old one"); + else + new->router_id = id; + } + } + return 0; } |