[prev in list] [next in list] [prev in thread] [next in thread]
List: samba-cvs
Subject: [SCM] Samba Shared Repository - branch master updated
From: Stefan Metzmacher <metze () samba ! org>
Date: 2023-12-21 11:10:02
Message-ID: E1rGGwD-00CIZi-UM () hrx0 ! samba ! org
[Download RAW message or body]
The branch, master has been updated
via 828f3c99122 s3:ctdbd_conn: fix ctdbd_public_ip_foreach() for ipv6 addresses
from 31637d40371 WHATSNEW: Add entry for "samba-tool user get-kerberos-ticket"
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 828f3c99122fb033ecb79e24ed24821b8510f0f8
Author: Stefan Metzmacher <metze@samba.org>
Date: Tue Aug 15 08:57:57 2023 +0200
s3:ctdbd_conn: fix ctdbd_public_ip_foreach() for ipv6 addresses
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15534
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Dec 21 11:09:30 UTC 2023 on atb-devel-224
-----------------------------------------------------------------------
Summary of changes:
source3/lib/ctdbd_conn.c | 33 ++++++++++++++++++++++++++++-----
1 file changed, 28 insertions(+), 5 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index a739c97f3fd..3698c9d3672 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -1438,6 +1438,32 @@ static int ctdbd_control_get_public_ips(struct ctdbd_connection *conn,
return 0;
}
+static struct samba_sockaddr ctdbd_sock_addr_to_samba(const ctdb_sock_addr *c)
+{
+ struct samba_sockaddr s = {};
+
+ switch (c->sa.sa_family) {
+ case AF_INET:
+ s.u.in = c->ip;
+ break;
+ case AF_INET6:
+ /*
+ * ctdb always requires HAVE_IPV6,
+ * so we don't need an ifdef here.
+ */
+ s.u.in6 = c->ip6;
+ break;
+ default:
+ /*
+ * ctdb_sock_addr only supports ipv4 and ipv6
+ */
+ smb_panic(__location__);
+ break;
+ }
+
+ return s;
+}
+
int ctdbd_public_ip_foreach(struct ctdbd_connection *conn,
int (*cb)(uint32_t total_ip_count,
const struct sockaddr_storage *ip,
@@ -1457,11 +1483,8 @@ int ctdbd_public_ip_foreach(struct ctdbd_connection *conn,
}
for (i=0; i < ips->num; i++) {
- struct samba_sockaddr tmp = {
- .u = {
- .sa = ips->ips[i].addr.sa,
- },
- };
+ const ctdb_sock_addr *addr = &ips->ips[i].addr;
+ struct samba_sockaddr tmp = ctdbd_sock_addr_to_samba(addr);
ret = cb(ips->num,
&tmp.u.ss,
--
Samba Shared Repository
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic