From owner-freebsd-net@FreeBSD.ORG Mon Jan 19 04:30:26 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 369C016A4CE for ; Mon, 19 Jan 2004 04:30:26 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E48443D3F for ; Mon, 19 Jan 2004 04:30:21 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.10/8.12.10) with ESMTP id i0JCUICf092688; Mon, 19 Jan 2004 13:30:19 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: "Randall R. Stewart (home)" From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 19 Jan 2004 06:13:25 CST." <400BC9E5.8010609@stewart.chicago.il.us> Date: Mon, 19 Jan 2004 13:30:18 +0100 Message-ID: <92687.1074515418@critter.freebsd.dk> cc: net@freebsd.org Subject: Re: Multihomed UDP server X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2004 12:30:26 -0000 In message <400BC9E5.8010609@stewart.chicago.il.us>, "Randall R. Stewart (home) " writes: >>>On Mon, 19 Jan 2004, 12:07+0100, Poul-Henning Kamp wrote: >>>>Simple question: >>>> >>>>Very simple UDP server daemon. >>>> >>>>Many clients (connect(2)'ing a socket for each is not an option) >>>> >>>>Multihomed machine. >>>> >>>>What's the simple trick to replying with the same source-IP as the >>>>client used as destination-IP ? >> >>I'm considering ways to make sendmsg(2)/recvmsg(2) DTRT, and my >>current candidate is give them a flag bit which says "msg_name has >>both addresses". Following the code it seems that it is in fact possible to do with sendmsg(2)/recvmsg(2) already, and my test shows that at least the receive side works. I challenge anybody to point out where this is mentioned in the docs, and once people give up I'll tell how to do it :-) >Poul: > >One of the problems I think that is fundamental to BSD and >multi-homing is the lack of supports for multiple-default routes. I agree. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.