diff options
author | Pavel Machek <pavel@ucw.cz> | 2000-05-16 16:58:06 +0200 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2000-05-16 16:58:06 +0200 |
commit | 898fdd85dc4568816ac0436c1b012f2fb35ef3e4 (patch) | |
tree | 9466289af581602020b475adaf893bd24df2e8a6 | |
parent | 60de3356ab9b1996a84e3ba2865176a078b6d0ca (diff) | |
download | bird-898fdd85dc4568816ac0436c1b012f2fb35ef3e4.tar bird-898fdd85dc4568816ac0436c1b012f2fb35ef3e4.zip |
Rip should now reconfigure itself only if needed.
-rw-r--r-- | proto/rip/rip.c | 12 | ||||
-rw-r--r-- | proto/rip/rip.h | 4 |
2 files changed, 11 insertions, 5 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c index 44d8ce0..1ac0eff 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -887,14 +887,20 @@ rip_get_attr(eattr *a, byte *buf) } static int +rip_pat_compare(struct rip_patt *a, struct rip_patt *b) +{ + return ((a->metric == b->metric) && + (a->mode == b->mode)); +} + +static int rip_reconfigure(struct proto *p, struct proto_config *c) { struct rip_proto_config *new = (struct rip_proto_config *) c; int generic = sizeof(struct proto_config) + sizeof(list) /* + sizeof(struct password_item *) */; - /* FIXME: patt_same needed */ - return 0; - + if (!iface_patts_equal(&P_CF->iface_list, &new->iface_list, (void *) rip_pat_compare)) + return 0; if (!password_same(P_CF->passwords, new->passwords)) return 0; diff --git a/proto/rip/rip.h b/proto/rip/rip.h index 442232d..185959a 100644 --- a/proto/rip/rip.h +++ b/proto/rip/rip.h @@ -111,7 +111,7 @@ struct rip_interface { struct rip_patt { struct iface_patt i; - int metric; + int metric; /* If you add entries here, don't forget to modify patt_compare! */ int mode; #define IM_BROADCAST 2 #define IM_QUIET 4 @@ -124,7 +124,7 @@ struct rip_proto_config { list iface_list; /* Patterns configured -- keep it first; see rip_reconfigure why */ struct password_item *passwords; /* Passwords, keep second */ - int infinity; /* User configurable data */ + int infinity; /* User configurable data; must be comparable with memcmp */ int port; int period; int garbage_time; |