1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

ctdb-daemon: Fix IP address comparisons for IPv6 addresses

Before storing node IP address, convert into the correct abbreviated
string form for IPv6 addresses.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2014-11-25 12:38:23 +11:00 committed by Martin Schwenke
parent d0b2375c3d
commit e3c59d83d0

View File

@ -100,12 +100,20 @@ int ctdb_parse_address(struct ctdb_context *ctdb,
struct ctdb_address *address)
{
struct servent *se;
ctdb_sock_addr addr;
setservent(0);
se = getservbyname("ctdb", "tcp");
endservent();
address->address = talloc_strdup(mem_ctx, str);
/* Parse IP address and re-convert to string. This ensure correct
* string form for IPv6 addresses.
*/
if (! parse_ip(str, NULL, 0, &addr)) {
return -1;
}
address->address = talloc_strdup(mem_ctx, ctdb_addr_to_str(&addr));
CTDB_NO_MEMORY(ctdb, address->address);
if (se == NULL) {