<div dir="ltr">Hi Simon,<div><br><div>Many thanks on this, really nice idea with linked list, i was really afraid of realloc compatibility issue with variety of platforms you support. Look forward for dnsmasq-2.81.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 10, 2020 at 12:47 PM Simon Kelley <<a href="mailto:simon@thekelleys.org.uk">simon@thekelleys.org.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Seems like a good thing to do. I took the opportunity to re-implement in<br>
the same code style at the existing code, but the functionality (should<br>
be) the same.<br>
<br>
<br>
<a href="http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=ab53883c94f94958e22077c79ba1dae1850a475e" rel="noreferrer" target="_blank">http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=ab53883c94f94958e22077c79ba1dae1850a475e</a><br>
<br>
<br>
Cheers,<br>
<br>
Simon.<br>
<br>
<br>
On 08/01/2020 00:11, Evgenii Seliavka wrote:<br>
> Hi there,<br>
> <br>
> I am extensively using dnsmasq in conjunction with *--conf-dir<br>
> *configuration property. My test env is *CentOS Linux release 7.4.1708<br>
> (Core) *with *3.10.0-693.17.1.el7.x86_64* kernel.<br>
> In our set up we strongly relying on the order dnsmasq will read and<br>
> apply DNS records under the configuration directory. Basically, we have<br>
> files like: 0001_this_should_be_first, 0002_comes_second, etc. and we<br>
> expecting them to be read in alpha order. We need this strict ordering<br>
> guarantee because of PTR records, according to the documentation only<br>
> first A record will receive corresponding PTR record:<br>
> <br>
> /--host-record=<name>[,<name>....],[<IPv4-address>],[<IPv6-address>][,<TTL>]<br>
> Add A, AAAA and PTR records to the DNS. This adds one or more names to<br>
> the DNS with associated IPv4 (A) and IPv6 (AAAA) records. A name may<br>
> appear in more than one --host-record and therefore be assigned more<br>
> than one address. Only the first address creates a PTR record linking<br>
> the address to the name. This is the same rule as is used reading<br>
> hosts-files. --host-record options are considered to be read before<br>
> host-files, so a name appearing there inhibits PTR-record creation if it<br>
> appears in hosts-file also. Unlike hosts-files, names are not expanded,<br>
> even when --expand-hosts is in effect. Short and long names may appear<br>
> in the same --host-record, eg.<br>
> --host-record=laptop,<a href="http://laptop.thekelleys.org" rel="noreferrer" target="_blank">laptop.thekelleys.org</a><br>
> <<a href="http://laptop.thekelleys.org" rel="noreferrer" target="_blank">http://laptop.thekelleys.org</a>>,192.168.0.1,1234::100 If the time-to-live<br>
> is given, it overrides the default, which is zero or the value of<br>
> --local-ttl. The value is a positive integer and gives the time-to-live<br>
> in seconds./<br>
> /<br>
> /<br>
> The problem is that *readdir* syscall can't guarantee any<br>
> order <a href="http://man7.org/linux/man-pages/man3/readdir.3.html" rel="noreferrer" target="_blank">http://man7.org/linux/man-pages/man3/readdir.3.html</a> at least on Linux.<br>
> <br>
> I prepared this small patch(see the attachment) and want to know<br>
> community opinion on how useful it is?<br>
> <br>
> -- <br>
> Best Regards,<br>
> Seliavka Evgenii<br>
> <br>
> _______________________________________________<br>
> Dnsmasq-discuss mailing list<br>
> <a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk" target="_blank">Dnsmasq-discuss@lists.thekelleys.org.uk</a><br>
> <a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" rel="noreferrer" target="_blank">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</a><br>
> <br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Best Regards,<br>Seliavka Evgenii</div></div>