summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdbd.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-12-14 19:33:35 +0100
committerStefan Metzmacher <metze@samba.org>2010-01-20 11:10:57 +0100
commitbec35e64414cd292b349c5b8fc824154201992f6 (patch)
treebfb1361ea645c18947a2b7bd00170bc428c978e1 /ctdb/server/ctdbd.c
parent628ac65709654a048b8a1cd75e4347926fe77e88 (diff)
downloadsamba-bec35e64414cd292b349c5b8fc824154201992f6.tar.gz
samba-bec35e64414cd292b349c5b8fc824154201992f6.tar.xz
samba-bec35e64414cd292b349c5b8fc824154201992f6.zip
server: add a ctdb_set_single_public_ip() helper function
metze (This used to be ctdb commit 400b4806c4a9686a2ee6398b5d7c3e0ca0793fd1)
Diffstat (limited to 'ctdb/server/ctdbd.c')
-rw-r--r--ctdb/server/ctdbd.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c
index 9fb63d745d6..2e707f243a5 100644
--- a/ctdb/server/ctdbd.c
+++ b/ctdb/server/ctdbd.c
@@ -282,24 +282,14 @@ int main(int argc, const char *argv[])
}
if (options.single_public_ip) {
- struct ctdb_vnn *svnn;
-
if (options.public_interface == NULL) {
DEBUG(DEBUG_ALERT,("--single_public_ip used but --public_interface is not specified. You must specify the public interface when using single public ip. Exiting\n"));
exit(10);
}
- svnn = talloc_zero(ctdb, struct ctdb_vnn);
- CTDB_NO_MEMORY(ctdb, svnn);
-
- ctdb->single_ip_vnn = svnn;
- svnn->iface = talloc_strdup(svnn, options.public_interface);
- CTDB_NO_MEMORY(ctdb, svnn->iface);
-
- if (parse_ip(options.single_public_ip,
- svnn->iface,
- 0,
- &svnn->public_address) == 0) {
+ ret = ctdb_set_single_public_ip(ctdb, options.public_interface,
+ options.single_public_ip);
+ if (ret != 0) {
DEBUG(DEBUG_ALERT,("Invalid --single-public-ip argument : %s . This is not a valid ip address. Exiting.\n", options.single_public_ip));
exit(10);
}