summaryrefslogtreecommitdiff
path: root/proto
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 /proto
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 'proto')
-rw-r--r--proto/bgp/bgp.c3
-rw-r--r--proto/ospf/ospf.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 346c641b..249d2e07 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -1009,6 +1009,9 @@ bgp_reconfigure(struct proto *P, struct proto_config *C)
struct bgp_proto *p = (struct bgp_proto *) P;
struct bgp_config *old = p->cf;
+ if (proto_get_router_id(C) != p->local_id)
+ return 0;
+
int same = !memcmp(((byte *) old) + sizeof(struct proto_config),
((byte *) new) + sizeof(struct proto_config),
// password item is last and must be checked separately
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index 6654e107..a3b6b2e7 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -729,6 +729,9 @@ ospf_reconfigure(struct proto *p, struct proto_config *c)
struct ospf_iface *ifa, *ifx;
struct ospf_iface_patt *ip;
+ if (proto_get_router_id(c) != po->router_id)
+ return 0;
+
if (po->rfc1583 != new->rfc1583)
return 0;