Draft #2: Re: [PATCH] SAMBA_3_0 : remove ldap_domain2hostlist()
Gerald (Jerry) Carter
jerry at samba.org
Thu May 4 22:14:06 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Love wrote:
> "Gerald (Jerry) Carter" <jerry at samba.org> writes:
>
>> FYI....
>>
>> Here's a short patch to replace the OpenLDAP ldap_domain2hostlist()
>> calls with a small internal dns query. The next step would be
>> to refactor the ads_dns_query_dcs() code to a generic DNS SRV
>> query function.
>
> You need to read up on RFC 2782 how to sort the dns srv
> rr entries.
>
> Also, you need to make the request space larger. I don't
> know how large your NS_PACKETSZ is, probably 512 which
> is the udp packet size, but it wont be large enough for
> the TCP with 100 DC's case (I'm not kidding, people do
> this).
Round #2.
I still need to fix the sorting and parsing of the
authority section (all the SRV replies I've seen so far have
0 authority records which is why I've ignored it for now).
This version is
(a) standalone (gcc -o dnstest dns_rr_srv.c -lresolve)
(b) handles retries when a larger buffer is required
(c) refactors the query and parsing code to be more generic
for reuse.
(d) pulls out the A records in the additional section
if the name matches
$ ./dnstest books.plainjoe.org
ads_dns_query_dcs: 1 records returned in the answer section.
windc.books.plainjoe.org (192.168.56.49)
bzr repo at
http://www.samba.org/~jerry/bzr/slag/unix/dns_rr-srv.c
cheers, jerry
=====================================================================
Samba ------- http://www.samba.org
Centeris ----------- http://www.centeris.com
"What man is a man who does not make the world better?" --Balian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iD8DBQFEWnyuIR7qMdg1EfYRAmSEAKCCkpTa3dV44wfd0x3yWOZg7wpaNACfWVtA
2W8fjjMhBgputz/QGWfM2u0=
=oFmB
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dns_rr_srv.c
Type: text/x-csrc
Size: 10527 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20060504/836d193b/dns_rr_srv.bin
More information about the samba-technical
mailing list