From owner-freebsd-hackers Wed Aug 27 10:19:33 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA16233 for hackers-outgoing; Wed, 27 Aug 1997 10:19:33 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id KAA16218 for ; Wed, 27 Aug 1997 10:19:28 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id KAA05689; Wed, 27 Aug 1997 10:16:12 -0700 From: Terry Lambert Message-Id: <199708271716.KAA05689@phaeton.artisoft.com> Subject: Re: UDP "to" address? To: louie@TransSys.COM (Louis A. Mamakos) Date: Wed, 27 Aug 1997 10:16:12 -0700 (MST) Cc: aledm@routers.co.uk, hackers@FreeBSD.ORG In-Reply-To: <199708261352.JAA04942@whizzo.TransSys.COM> from "Louis A. Mamakos" at Aug 26, 97 09:52:07 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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. This is an issue for the NFS UDP code, actually. If you get a general answer, it'd be helpful. I thin recvmsg() is probably the way to go. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.