summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ctdb/protocol/protocol_util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ctdb/protocol/protocol_util.c b/ctdb/protocol/protocol_util.c
index 77e79867443..a46cde9f46f 100644
--- a/ctdb/protocol/protocol_util.c
+++ b/ctdb/protocol/protocol_util.c
@@ -251,6 +251,9 @@ static int ip_from_string(const char *str, ctdb_sock_addr *addr)
if (memcmp(&addr->ip6.sin6_addr.s6_addr[0],
ipv4_mapped_prefix,
sizeof(ipv4_mapped_prefix)) == 0) {
+ /* Initialize addr struct to zero before reparsing as IPV4 */
+ ZERO_STRUCTP(addr);
+
/* Reparse as IPv4 */
ret = ipv4_from_string(p+1, &addr->ip);
}