Re: can anybody review my patchset?
Matthew Dempsky <[email protected]>
| Newsgroups | gmane.network.djbdns |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Apr 20, 2009 at 12:29 AM, Andreas Schulze <[email protected]> wrote: > 6. dnscache rotating A-Records http://thomas.mangin.com/data/source/djbdns-round-robin.patch.bz2 This patch doesn't even compile due to a syntax error: + if byte_equal(key,2,DNS_T_A) dns_rotateip(x + pos + 20 + keylen,u); Ignoring that, dnscache currently serves recordsets in the same order that servers send to it. I don't see any harm in dnscache permuting the order of A records within a recordset, but if you want this sort of functionality I would instead do the permutation in query.c rather than cache.c like below. (Patch below just uses dns_sortip.) (I still don't care for this patch either, because I don't like the idea of the client mutating the data already in the cache, but cache_get returns a "char *" instead of a "const char *", so I guess this is okay...) --- query.c.orig 2009-04-20 01:46:12.000000000 -0700 +++ query.c 2009-04-20 01:47:01.000000000 -0700 @@ -337,6 +337,7 @@ static int doit(struct query *z,int stat goto LOWERLEVEL; } + dns_sortip(cached,cachedlen); log_cachedanswer(d,DNS_T_A); if (!rqa(z)) goto DIE; while (cachedlen >= 4) {