[rbldnsd] Option -d (Bind dump) and wildcards: a small problem

Michael Tokarev mjt at tls.msk.ru
Mon Dec 13 05:12:46 MSK 2004


Michael Tokarev wrote:
> Amos Jeffries wrote:
[]
>> Code for the replacement ds_ip4set_dump function is at
>> http://eyezone.mine.nu/source/rbldnsd/rbldnsd_ip4set_dump.c
>> for checkup testing and approval.
>> I have debugged it as far as logic and compiling against 0.993.1 (29 
>> Jul 2004).
> 
> Got it.  Care to explain how it works? ;)
> Funny enouth, I can't seem to understand it.

Ok, after looking at your code, thinking, looking at it again,
looking again, and more thinking... ;)  Looks like we now have
a working solution.  Amos, that was exactly what needed: after
reading and understanding (yeah, finally! ;) your routines,
I come across a clean, more or less, implementation.  I'm somewhat
afraid I haven't used your code directly, maybe i was wrong
(after all, this very function - generating master-format zonefile --
isn't used very often, and isn't really speed-critical, so it is
almost irrelevant how fast/whatever does it work...)...  In short:

I uploaded new tarball into the directory
   http://www.corpit.ru/mjt/rbldnsd/pre/
with fixes for this and two other problems.  The changes are
quite large, mostly because of moving routines from one file
to another (where they belongs to in the first place, really),
and because of large amount of comments in the new code, in
particular in this ip4set dump routines.  But due to the comments,
it should be relatively easy to understand what's going on in
there and why.

I also found another edge case with that "intermediate" records
in master-file.  Suppose we have
   127/8      a
   !127.0/16
   127.0.0.2  b
With this, only 3 lines are necessary in the resulting file for
named (well, 2 really, with second being redundrand, but that's
another evil optimisation which is (currently) missing):

       *.127   a
     *.0.127   CNAME excluded
   2.0.0.127   b

(in this case, there's no need to add `*.0.0.127 excluded' entry).

Here's what it produces from the following input:

127/8           :10:
127/8           :20:
127/8           :30:
127.2/16        :12:
127.2/16        :22:
127.2/16        :32:
127.2.3.4       :11:
127.3.4.5       :12:
127.4.5/24      :13:
127.4.5/24      :23:
127.4.5.6       :14:
!127.5/16
127.5.6/24      :15:
!127.6/16
127.6.7.8       :16:

Result (indented for readability):

; zone dump made Mon Dec 13 05:07:01 2004
; rbldnsd version 0.993.9 (13 Dec 2004)
$ORIGIN x.
$TTL 2100
*.3.2.127       A       127.0.0.12
*.3.2.127       A       127.0.0.22
*.3.2.127       A       127.0.0.32
4.3.2.127       A       127.0.0.11
   *.2.127       A       127.0.0.12
   *.2.127       A       127.0.0.22
   *.2.127       A       127.0.0.32
   *.3.127       A       127.0.0.10
   *.3.127       A       127.0.0.20
   *.3.127       A       127.0.0.30
*.4.3.127       A       127.0.0.10
*.4.3.127       A       127.0.0.20
*.4.3.127       A       127.0.0.30
5.4.3.127       A       127.0.0.12
   *.4.127       A       127.0.0.10
   *.4.127       A       127.0.0.20
   *.4.127       A       127.0.0.30
6.5.4.127       A       127.0.0.14
*.5.4.127       A       127.0.0.13
*.5.4.127       A       127.0.0.23
*.6.5.127       A       127.0.0.15
   *.5.127       CNAME   excluded
8.7.6.127       A       127.0.0.16
   *.6.127       CNAME   excluded
     *.127       A       127.0.0.10
     *.127       A       127.0.0.20
     *.127       A       127.0.0.30

At least I don't see any obvious errors in this set... ;)

Amos, please tell me whenever you like this new variant,
and whenever you think your version should be used instead
(with minor corrections as per my previous email).  And
thank you very much for helping with this case.

/mjt


More information about the rbldnsd mailing list