]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[DLM] zero unused parts of sockaddr_storage
authorPatrick Caulfield <pcaulfie@redhat.com>
Tue, 17 Jul 2007 15:53:15 +0000 (16:53 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Tue, 14 Aug 2007 09:29:27 +0000 (10:29 +0100)
When we build a sockaddr_storage for an IP address, clear the unused parts as
they could be used for node comparisons.

I have seen this occasionally make sctp connections fail.

Signed-Off-By: Patrick Caulfield <pcaulfie@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/dlm/lowcomms.c

index d15fd5f9f5c562f17f9a275a2c7646c948d72a83..631bc431e6af92230380b784cfe5dee9e776064b 100644 (file)
@@ -313,6 +313,7 @@ static void make_sockaddr(struct sockaddr_storage *saddr, uint16_t port,
                in6_addr->sin6_port = cpu_to_be16(port);
                *addr_len = sizeof(struct sockaddr_in6);
        }
+       memset((char *)saddr + *addr_len, 0, sizeof(struct sockaddr_storage) - *addr_len);
 }
 
 /* Close a remote connection and tidy up */