[bind10-dev] fd_share / send_fd

Danny Mayer mayer at gis.net
Wed Jul 27 03:41:56 UTC 2011


I don't think that I commented on this.

On 4/7/2011 10:30 AM, Shane Kerr wrote:
> Right now we only move sockets. We have 2 use cases:
> 
>      1. TCP connections arrive at the authoritative or recursive
>         resolver and need to get transferred to the XFR out process.
>      2. In future we'll have our privileged socket creator which will
>         create all sockets on ports < 1024 and need to transfer those
>         bound sockets to other processes.
> 
>>  - there are other ways to send a file descriptor, for instance
>>   one can open /proc/<other_process_id>/fd/<file_descriptor_number>
>>   on Linux or in general any OS with /proc file system.
>>   I'd like to get a fd_share / send_fd clone using this /proc way
>>   (IMHO it is far closer than PF_UNIX to what Windows support,
>>    and this can remove some dependencies too).
> 
> Hm... by default FreeBSD doesn't mount the procfs, and it doesn't look
> like it ever supported the "fd" directory.
> 
> With Windows I was assuming we'd use something like DuplicateHandle:
> 
> http://msdn.microsoft.com/en-us/library/ms724251%28VS.85%29.aspx
> 
> In theory we should be able pass sockets around with this function,
> since according to the documentation sockets are also normal Windows
> handles:
> 
> http://msdn.microsoft.com/en-us/library/ms740522%28v=VS.85%29.aspx
> 

No, Sockets are instances of Windows handles but they are not just
handles. This very reference also tells you that you should NOT be using
them with DuplicateHandle because of the problems with LSP's (WSP's) if
they are present on the system. I have no desire to explain what those
are and it's not particularly useful to discuss in this context. Just
keep in mind that at least one of the Windows antivirus providers uses them.

Danny



More information about the bind10-dev mailing list