From owner-freebsd-net Tue Nov 7 18:24:32 2000 Delivered-To: freebsd-net@freebsd.org Received: from whizzo.transsys.com (whizzo.TransSys.COM [144.202.42.10]) by hub.freebsd.org (Postfix) with ESMTP id 3A9D337B4C5 for ; Tue, 7 Nov 2000 18:24:29 -0800 (PST) Received: from whizzo.transsys.com (localhost.transsys.com [127.0.0.1]) by whizzo.transsys.com (8.11.0/8.11.0) with ESMTP id eA82OHG61786; Tue, 7 Nov 2000 21:24:17 -0500 (EST) (envelope-from louie@whizzo.transsys.com) Message-Id: <200011080224.eA82OHG61786@whizzo.transsys.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: Thomas Moestl Cc: freebsd-net@FreeBSD.ORG X-Image-URL: http://www.transsys.com/louie/images/louie-mail.jpg From: "Louis A. Mamakos" Subject: Re: setting source address for UDP packets References: <20001107214749.A2125@forge.local> <200011072156.QAA87433@khavrinen.lcs.mit.edu> <20001108003253.A5469@forge.local> In-reply-to: Your message of "Wed, 08 Nov 2000 00:32:54 +0100." <20001108003253.A5469@forge.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 07 Nov 2000 21:24:17 -0500 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Take a look at the code for the NTP daemon. Simply, it creates and bind()'s a socket for each interface address associated with a multi-homed host (original application) or "alias" address. It then remembers what socket a query arrived on, and replies using the same socket to ensure the source address of the reply matches what the query was sent to. This is required to make the NTP protocol work. Yes, it's sort of a crock, but for typical hosts with only a few network interfaces/addresses, is probably workable. louie To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message