> On Nov 17, 2007 4:58 PM, Rolf Sommerhalder
> <[EMAIL PROTECTED]> wrote:
> 
> > Still, I am unsure if the DNS/UDP relay actually behaves correctly,
> > and if this work-around does make sense.
> 
> After a deep dive into the sources of hoststated, my current
> understanding is that this is not a problem caused by hoststated
> itself, but rather how the underlaying IP stack determines the source
> IP address of a UDP packet when the server is multi-homed.
> 
> relay_dns_request() in src/usr.sbin/hoststated/relay_udp.c calls
> sendto() with the correct destination IP. However, the source IP
> address can not be passed to sendto().
> 
> Are there facilities to set the source address for UDP packets sent
> from a multi-homed server?

Oh, one does that by calling bind() beforehands, with the specific
local address one which uses use, instead of 0.0.0.0.  With udp this
works nicely because you can rebind a udp socket multiple times.  The
same thing does not work with tcp, for the obvious reasons.

However I don't know how this maps to the problem space inside
hoststated; I just wanted to mention that it is possible to solve the
specific problem you ask about.

Reply via email to