[prev in list] [next in list] [prev in thread] [next in thread] 

List:       djbdns
Subject:    Re: binding a SOCK_DGRAM to multiple interfaces
From:       "Rob Mayoff" <mayoff () dqd ! com>
Date:       2001-10-03 23:28:56
[Download RAW message or body]

+---------- On Oct 3, David Nicol said:
> 1:  run dnscache on the external interface, and make local
> programs use the external interface instead of the faster local
> interface.

This would be the normal approach.  Is the external interface really
slower?  Does it make a difference?

> 2:  alter dnscache so that it can bind to both the internal and
> the external interfaces.
>
> TCP servers can do this.  Is the problem that a UDP server cannot
> do that because the recvmsg function does not tell you which interface
> the packet arrived at?

recvmsg tells you the destination address of the packet if you use
IP_RECVDSTADDR, but that might not be supported everywhere.  You can
just create a separate socket for each IP address and use SO_REUSEADDR
to do it portably.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic