From owner-freebsd-hackers Wed Aug 27 02:23:27 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id CAA22253 for hackers-outgoing; Wed, 27 Aug 1997 02:23:27 -0700 (PDT) Received: from uk.ns.eu.org ([194.117.157.5]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id CAA22248 for ; Wed, 27 Aug 1997 02:23:20 -0700 (PDT) Received: (from aledm@localhost) by ns.uk.peer.net (8.6.12/8.6.12) id RAA21813; Tue, 26 Aug 1997 17:09:12 +0100 Date: Tue, 26 Aug 1997 17:08:37 +0100 (BST) From: Aled Morris X-Sender: aledm@routers.co.uk To: "Louis A. Mamakos" cc: hackers@FreeBSD.ORG Subject: Re: UDP "to" address? In-Reply-To: <199708261352.JAA04942@whizzo.TransSys.COM> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Tue, 26 Aug 1997, Louis A. Mamakos wrote: > 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. That sounds like the best way - unfortunately, I'm currently using inetd, so I'll have to do a bit more work... > 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. I've just had a look, INP_RECVDSTADDR looks like the one. I don't know how to set it, or how to recover the data, but I'm sure someone will have a nifty code fragment (please?) Aled -- tel +44 973 207987 O- aledm@routers.co.uk