Simon Kelley e48a2af4f5 Overhaul extract_addresses() function.
The proximate cause for doing this is to fix a bug that
causes replies to PTR queries with more than one answer to have the
second and subsequent answers ignored.

The fix turned into a small re-write which removed a very old hack.
When caching reponses which include CNAME records, the cache system
stores the CNAME with a link to the record representing the target of
the CNAME. This isn't possible for PTR records representing IP
addresses since the name stored is the target of the PTR, record and
its name is inferred from the address in the cache record. Such
cache records have the F_REVERSE flag set. To get
around this, long ago, the code which stores such records elided the
CNAME entirely, so
4.3.2.1.in-addr.arpa   CNAME 18/3.2.1.in-addr.arpa
18/3.2.1.in-addr.arpa   PTR   myhost.example.com

would be stored as
4.3.2.1.in-addr.arpa PTR   myhost.example.com

and returned from the cache to subsequent requestor in that form.

Since that hack was committed, dnsmasq has learned to cache arbitrary
RRs. So now we can store the PTR records for all the no-trivial cases.

The means the CNAME chains ending in PTR records don't get mangled,
and we can store PTR records whose name in not w.x.y.x.in-addr.arpa
or the IPv6 equivalent.
2025-05-18 17:24:41 +01:00
2012-04-02 20:40:34 +01:00
2024-12-24 09:47:41 +00:00
2012-01-05 17:31:15 +00:00
2018-01-14 17:32:52 +00:00
2022-05-13 21:22:11 +01:00
2012-01-05 17:31:13 +00:00
2021-06-15 23:14:59 +01:00
2025-01-23 17:08:39 +00:00
2018-01-14 17:32:52 +00:00
2024-12-18 23:58:58 +00:00
2012-01-05 22:00:08 +00:00
Description
No description provided
17 MiB
Languages
C 94.2%
Perl 2.3%
HTML 1.2%
Shell 1.1%
Makefile 0.6%
Other 0.6%