summaryrefslogtreecommitdiff
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-07-09 15:42:39 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2009-07-09 15:42:39 +0200
commit70670bf317a612a1700ffbd0dbc8d92614e0caf2 (patch)
tree73c9643b87cb65b6106ddc430597148f07153a98 /proto/bgp/bgp.c
parentdd7b4a13848f5a92b403a563e8e27a3cbdfc937f (diff)
Fixed bug related to reconfiguration of BGP with MD5 passwords.
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index a6b9d574..0c8ee6da 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)