rip_reconfigure done right

This commit is contained in:
Pavel Machek 2000-05-10 13:05:39 +00:00
parent b8524e9be4
commit 30aa02d70d
2 changed files with 5 additions and 4 deletions

View file

@ -868,10 +868,11 @@ static int
rip_reconfigure(struct proto *p, struct proto_config *c) rip_reconfigure(struct proto *p, struct proto_config *c)
{ {
struct rip_config *new = (struct rip_config *) c; struct rip_config *new = (struct rip_config *) c;
int generic = sizeof(struct proto_config) + sizeof(list);
return !memcmp(((byte *) P_CF) + sizeof(struct proto_config), return !memcmp(((byte *) P_CF) + generic,
((byte *) new) + sizeof(struct proto_config), ((byte *) new) + generic,
sizeof(struct rip_proto_config) - sizeof(struct proto_config)); sizeof(struct rip_proto_config) - generic);
} }
struct protocol proto_rip = { struct protocol proto_rip = {

View file

@ -120,7 +120,7 @@ struct rip_patt {
struct rip_proto_config { struct rip_proto_config {
struct proto_config c; struct proto_config c;
list iface_list; /* Patterns configured */ list iface_list; /* Patterns configured -- keep it first; see rip_reconfigure why */
int infinity; /* User configurable data */ int infinity; /* User configurable data */
int port; int port;