[bind10-dev] Some thoughts about XFR

Shane Kerr shane at isc.org
Thu Mar 4 09:55:10 UTC 2010


Likun,

On Thu, 2010-03-04 at 09:08 +0800, zhanglikun wrote:
> 2. Xfrout:        
>       Ath server will get the XFR query on port 53(or others), then send
> the client information to module xfrout through msgq(c-channel), xfrout
> will connect with xfr client directly, when zone transfer is finished,
> xfrout will close the connection.  (*If somebody has a good suggestion
> ,please let me know.  :)

Will this work? If the client connects with TCP, then we will have an
open socket file descriptor that we get from the accept() system call.
This needs to be handed to the xfrout somehow. We can either do this:

     1. By using fork()/exec() and starting a new xfrout process that
        inherits the file descriptor.
     2. Sending the open file descriptor between processes using the
        sendmsg() command.

Either will work - I actually think method #2 is cleaner, although
apparently not so standard. There is a library that implements this on
Linux, Solaris, OpenBSD, and FreeBSD - which probably means that it is
"standard enough":

        http://www.normalesup.org/~george/comp/libancillary/

The entire library is only about 300 lines, most of which is only in a
couple functions.

A thread about this can be found here:

http://stackoverflow.com/questions/670891/is-there-a-way-for-multiple-processes-to-share-a-listening-socket

I don't know how to get this sort of functionality from Python. I
suspect it is possible but may involve using system calls directly.

--
Shane




More information about the bind10-dev mailing list