From owner-freebsd-net Tue Nov 7 12:48:22 2000 Delivered-To: freebsd-net@freebsd.org Received: from mail.gmx.net (pop.gmx.net [194.221.183.20]) by hub.freebsd.org (Postfix) with SMTP id D96DB37B479 for ; Tue, 7 Nov 2000 12:48:19 -0800 (PST) Received: (qmail 11748 invoked by uid 0); 7 Nov 2000 20:48:18 -0000 Received: from p3e9e03d9.dip.t-dialin.net (HELO forge.local) (62.158.3.217) by mail.gmx.net (mail06) with SMTP; 7 Nov 2000 20:48:18 -0000 Received: from thomas by forge.local with local (Exim 3.12 #1 (Debian)) id 13tFeo-0000YX-00 for ; Tue, 07 Nov 2000 21:47:50 +0100 Date: Tue, 7 Nov 2000 21:47:50 +0100 To: freebsd-net@freebsd.org Subject: setting source address for UDP packets Message-ID: <20001107214749.A2125@forge.local> Mail-Followup-To: tmoestl@gmx.net, freebsd-net@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i From: Thomas Moestl Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, is there any way to set the source address of an UDP (over IPv4) packet without using bind() or changing the socket state, ala the IN6_PKTINFO ancillary data to sendmsg? Background: in a multithreaded server, I want to answer with the source address the query went to. This will work normally, but if the packet leaves through another interface than that it arrived on, it will off course get a different source address. There are some routing situations where such things can happen. I cannot use bind(), because the socket is shared by other threads. I could of course lock the socket in some way, but since the send()-call can block, this is suboptimal. Any ideas? Thanks in advance, Thomas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message