Rev 461: don't crash doing ctdb ip when not doing takeover in
http://samba.org/~tridge/ctdb
tridge at samba.org
tridge at samba.org
Mon Jun 4 12:28:53 GMT 2007
------------------------------------------------------------
revno: 461
revision-id: tridge at samba.org-20070604122852-z351kj9m6s28x08f
parent: tridge at samba.org-20070604121359-iyitumtjbhllb84j
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Mon 2007-06-04 22:28:52 +1000
message:
don't crash doing ctdb ip when not doing takeover
modified:
takeover/ctdb_takeover.c ctdb_takeover.c-20070525071636-a5n1ihghjtppy08r-2
=== modified file 'takeover/ctdb_takeover.c'
--- a/takeover/ctdb_takeover.c 2007-06-04 12:13:59 +0000
+++ b/takeover/ctdb_takeover.c 2007-06-04 12:28:52 +0000
@@ -692,7 +692,7 @@
/*
-
+ get list of public IPs
*/
int32_t ctdb_control_get_public_ips(struct ctdb_context *ctdb, struct ctdb_req_control *c, TDB_DATA *outdata)
{
@@ -701,7 +701,7 @@
len = offsetof(struct ctdb_all_public_ips, ips) + ctdb->num_nodes*sizeof(struct ctdb_public_ip);
- ips = talloc_size(outdata, len);
+ ips = talloc_zero_size(outdata, len);
CTDB_NO_MEMORY(ctdb, ips);
outdata->dsize = len;
@@ -712,7 +712,9 @@
ips->ips[i].vnn = i;
ips->ips[i].takeover_vnn = ctdb->nodes[i]->takeover_vnn;
ips->ips[i].sin.sin_family = AF_INET;
- inet_aton(ctdb->nodes[i]->public_address, &ips->ips[i].sin.sin_addr);
+ if (ctdb->nodes[i]->public_address) {
+ inet_aton(ctdb->nodes[i]->public_address, &ips->ips[i].sin.sin_addr);
+ }
}
return 0;
More information about the samba-cvs
mailing list