From owner-freebsd-hackers Tue Aug 26 07:02:18 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id HAA11683 for hackers-outgoing; Tue, 26 Aug 1997 07:02:18 -0700 (PDT) Received: from whizzo.TransSys.COM (whizzo.TransSys.COM [144.202.42.10]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id HAA11676 for ; Tue, 26 Aug 1997 07:02:13 -0700 (PDT) Received: from localhost.transsys.com (localhost.transsys.com [127.0.0.1]) by whizzo.TransSys.COM (8.8.7/8.7.3) with SMTP id JAA04942; Tue, 26 Aug 1997 09:52:07 -0400 (EDT) Message-Id: <199708261352.JAA04942@whizzo.TransSys.COM> X-Mailer: exmh version 2.0zeta 7/24/97 To: Aled Morris cc: hackers@FreeBSD.ORG From: "Louis A. Mamakos" Subject: Re: UDP "to" address? References: In-reply-to: Your message of "Tue, 26 Aug 1997 13:42:45 BST." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 26 Aug 1997 09:52:07 -0400 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. louie