s3:ctdbd_conn: pass vnn to ctdbd_control_get_public_ips()
authorStefan Metzmacher <metze@samba.org>
Fri, 11 Aug 2023 09:30:07 +0000 (11:30 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 23 Jan 2024 10:12:19 +0000 (11:12 +0100)
In future we also want to ask other nodes for their public_ips.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/lib/ctdbd_conn.c

index 3698c9d3672473e9f2719f0e4c9a3b7b1130d67f..b03539ccd78f5d85f9516ad02994e956b31f5b3f 100644 (file)
@@ -1393,6 +1393,7 @@ void ctdbd_passed_ips(struct ctdbd_connection *conn,
 }
 
 static int ctdbd_control_get_public_ips(struct ctdbd_connection *conn,
+                                       uint32_t vnn,
                                        uint32_t flags,
                                        TALLOC_CTX *mem_ctx,
                                        struct ctdb_public_ip_list_old **_ips)
@@ -1406,14 +1407,15 @@ static int ctdbd_control_get_public_ips(struct ctdbd_connection *conn,
 
        *_ips = NULL;
 
-       ret = ctdbd_control_local(conn,
-                                 CTDB_CONTROL_GET_PUBLIC_IPS,
-                                 0, /* srvid */
-                                 flags,
-                                 tdb_null, /* indata */
-                                 mem_ctx,
-                                 &outdata,
-                                 &cstatus);
+       ret = ctdbd_control(conn,
+                           vnn,
+                           CTDB_CONTROL_GET_PUBLIC_IPS,
+                           0, /* srvid */
+                           flags,
+                           tdb_null, /* indata */
+                           mem_ctx,
+                           &outdata,
+                           &cstatus);
        if (ret != 0 || cstatus != 0) {
                DBG_ERR("ctdb_control for getpublicips failed ret:%d cstatus:%d\n",
                        ret, (int)cstatus);
@@ -1476,7 +1478,7 @@ int ctdbd_public_ip_foreach(struct ctdbd_connection *conn,
        int ret = ENOMEM;
        TALLOC_CTX *frame = talloc_stackframe();
 
-       ret = ctdbd_control_get_public_ips(conn, 0, frame, &ips);
+       ret = ctdbd_control_get_public_ips(conn, CTDB_CURRENT_NODE, 0, frame, &ips);
        if (ret < 0) {
                ret = EIO;
                goto out_free;