From 70670bf317a612a1700ffbd0dbc8d92614e0caf2 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 9 Jul 2009 15:42:39 +0200 Subject: Fixed bug related to reconfiguration of BGP with MD5 passwords. --- proto/bgp/bgp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'proto') diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index a6b9d57..0c8ee6d 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -927,7 +927,10 @@ bgp_reconfigure(struct proto *P, struct proto_config *C) int same = !memcmp(((byte *) old) + sizeof(struct proto_config), ((byte *) new) + sizeof(struct proto_config), - sizeof(struct bgp_config) - sizeof(struct proto_config)); + // password item is last and must be checked separately + OFFSETOF(struct bgp_config, password) - sizeof(struct proto_config)) + && ((!old->password && !new->password) + || (old->password && new->password && !strcmp(old->password, new->password))); /* We should update our copy of configuration ptr as old configuration will be freed */ if (same) -- cgit v1.2.3