Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Aug 1997 09:52:07 -0400
From:      "Louis A. Mamakos" <louie@TransSys.COM>
To:        Aled Morris <aledm@routers.co.uk>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: UDP "to" address? 
Message-ID:  <199708261352.JAA04942@whizzo.TransSys.COM>
In-Reply-To: Your message of "Tue, 26 Aug 1997 13:42:45 BST." <Pine.BSF.3.91.970826134032.21490D-100000@ns.uk.peer.net> 
References:  <Pine.BSF.3.91.970826134032.21490D-100000@ns.uk.peer.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
Typically, a portable approach to doing this is to create a socket
per interface address and bind it.  Then you look at which fd the
packet was received on to determine the destination address.

Look at named and xntpd to get a sense of this.  In fact, you can
probably steal a lot of this code and apply it directly.  

There also seems to be a socket option you can set which returns the
destination address in the "control information" field specified
with recvmsg(2).   I noticed the code for this in ip_input.c.

louie





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708261352.JAA04942>