From: David Teigland <teigland@redhat.com>

If an address has already been set for a node, don't add it again.

Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/dlm/lowcomms.c |    9 +++++++++
 1 files changed, 9 insertions(+)

diff -puN drivers/dlm/lowcomms.c~dlm-communication-dlm-dont-add-duplicate-node-addresses drivers/dlm/lowcomms.c
--- 25/drivers/dlm/lowcomms.c~dlm-communication-dlm-dont-add-duplicate-node-addresses	Thu Jun  2 16:31:37 2005
+++ 25-akpm/drivers/dlm/lowcomms.c	Thu Jun  2 16:31:37 2005
@@ -272,6 +272,7 @@ int dlm_set_node(int nodeid, int weight,
 int dlm_set_local(int nodeid, int weight, char *addr_buf)
 {
 	struct sockaddr_storage *addr;
+	int i;
 
 	if (local_count > DLM_MAX_ADDR_COUNT - 1) {
 		log_print("too many local addresses set %d", local_count);
@@ -284,7 +285,15 @@ int dlm_set_local(int nodeid, int weight
 	if (!addr)
 		return -ENOMEM;
 	memcpy(addr, addr_buf, sizeof(*addr));
+
+	for (i = 0; i < local_count; i++) {
+		if (!memcmp(local_addr[i], addr, sizeof(*addr))) {
+			kfree(addr);
+			goto out;
+		}
+	}
 	local_addr[local_count++] = addr;
+ out:
 	return 0;
 }
 
_