The Samba-Bugzilla – Attachment 17637 Details for
Bug 15226
samba-tool gpo listall fails IPv6 only - finddcs() fails to find DC when there is only an AAAA record for the DC in DNS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for master.
0001-s4-libcli-Fix-reply_to_addrs-to-return-IPv6-addresse.patch (text/plain), 3.14 KB, created by
Jeremy Allison
on 2022-11-08 01:53:31 UTC
(
hide
)
Description:
git-am fix for master.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2022-11-08 01:53:31 UTC
Size:
3.14 KB
patch
obsolete
>From c400e35bf52a5ef393ba20ae926e6670bfa41ea6 Mon Sep 17 00:00:00 2001 >From: Matt Grant <matt@mattgrant.net.nz> >Date: Mon, 7 Nov 2022 10:14:27 -0800 >Subject: [PATCH] s4: libcli: Fix reply_to_addrs() to return IPv6 addresses as > well as IPv4. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15226 > >Signed-off-by: Matt Grant <matt@mattgrant.net.nz> >Pair-programmed-with: Jeremy Allison <jra@samba.org> >--- > source4/libcli/resolve/dns_ex.c | 59 ++++++++++++--------------------- > 1 file changed, 22 insertions(+), 37 deletions(-) > >diff --git a/source4/libcli/resolve/dns_ex.c b/source4/libcli/resolve/dns_ex.c >index 0bb3ba02287..57c96739f19 100644 >--- a/source4/libcli/resolve/dns_ex.c >+++ b/source4/libcli/resolve/dns_ex.c >@@ -107,14 +107,6 @@ static int reply_to_addrs(TALLOC_CTX *mem_ctx, uint32_t *a_num, > continue; > } > >- if (rr->type == QTYPE_NS) { >- /* >- * After the record for NS will come the A or AAAA >- * record of the NS. >- */ >- break; >- } >- > /* verify we actually have a record here */ > if (!rr->data) { > continue; >@@ -151,9 +143,7 @@ static int reply_to_addrs(TALLOC_CTX *mem_ctx, uint32_t *a_num, > rr->name->pLabelList->label); > if (addrs[total]) { > total++; >- if (rr->type == QTYPE_A) { >- (*a_num)++; >- } >+ (*a_num)++; > } > } > >@@ -212,7 +202,6 @@ static struct dns_records_container get_a_aaaa_records(TALLOC_CTX *mem_ctx, > struct dns_records_container ret; > char **addrs = NULL; > uint32_t a_num, total; >- uint16_t qtype; > TALLOC_CTX *tmp_ctx; > DNS_ERROR err; > >@@ -223,36 +212,33 @@ static struct dns_records_container get_a_aaaa_records(TALLOC_CTX *mem_ctx, > return ret; > } > >- qtype = QTYPE_AAAA; >+ a_num = total = 0; > > /* this is the blocking call we are going to lots of trouble > to avoid them in the parent */ >- err = dns_lookup(tmp_ctx, name, qtype, &reply); >- if (!ERR_DNS_IS_OK(err)) { >- qtype = QTYPE_A; >- err = dns_lookup(tmp_ctx, name, qtype, &reply); >- if (!ERR_DNS_IS_OK(err)) { >- goto done; >- } >+ /* First ask for A records. */ >+ err = dns_lookup(tmp_ctx, name, QTYPE_A, &reply); >+ if (ERR_DNS_IS_OK(err)) { >+ total = reply_to_addrs(tmp_ctx, >+ &a_num, >+ &addrs, >+ total, >+ reply, >+ port); > } > >- a_num = total = 0; >- total = reply_to_addrs(tmp_ctx, &a_num, &addrs, total, reply, port); >- >- if (qtype == QTYPE_AAAA && a_num == 0) { >- /* >- * DNS server didn't returned A when asked for AAAA records. >- * Most of the server do it, let's ask for A specificaly. >- */ >- err = dns_lookup(tmp_ctx, name, QTYPE_A, &reply); >- if (!ERR_DNS_IS_OK(err)) { >- goto done; >- } >- >- total = reply_to_addrs(tmp_ctx, &a_num, &addrs, total, >- reply, port); >- >+#ifdef HAVE_IPV6 >+ /* Now ask for AAAA records. */ >+ err = dns_lookup(tmp_ctx, name, QTYPE_AAAA, &reply); >+ if (ERR_DNS_IS_OK(err)) { >+ total = reply_to_addrs(tmp_ctx, >+ &a_num, >+ &addrs, >+ total, >+ reply, >+ port); > } >+#endif > > if (total) { > talloc_steal(mem_ctx, addrs); >@@ -260,7 +246,6 @@ static struct dns_records_container get_a_aaaa_records(TALLOC_CTX *mem_ctx, > ret.list = addrs; > } > >-done: > TALLOC_FREE(tmp_ctx); > return ret; > } >-- >2.34.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 15226
:
17630
|
17637
|
17638
|
17642