From owner-freebsd-arch@FreeBSD.ORG Wed Apr 1 01:24:21 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21C98106566C for ; Wed, 1 Apr 2009 01:24:21 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from skerryvore.cs.uoguelph.ca (skerryvore.cs.uoguelph.ca [131.104.94.204]) by mx1.freebsd.org (Postfix) with ESMTP id B69B48FC1D for ; Wed, 1 Apr 2009 01:24:20 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by skerryvore.cs.uoguelph.ca (8.13.1/8.13.1) with ESMTP id n311OHfS030593; Tue, 31 Mar 2009 21:24:17 -0400 Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n311UDj07163; Tue, 31 Mar 2009 21:30:13 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Tue, 31 Mar 2009 21:30:13 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: Julian Elischer In-Reply-To: <49D27DDF.9@elischer.org> Message-ID: References: <49D13E9C.8010005@elischer.org> <49D27DDF.9@elischer.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Scanned-By: MIMEDefang 2.63 on 131.104.94.204 Cc: freebsd-arch@freebsd.org Subject: Re: getting a callback ip address for nfsv4 client X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 01:24:21 -0000 On Tue, 31 Mar 2009, Julian Elischer wrote: > > looks about right (without doing great analysis). > > You may be able to make it a bit simpler by calling rtalloc1() directly.. Yep, I can see it would be. Is there a preferred interface or should I just recode it using rtalloc1()? > > As there are possibly many addresses on an interface, one needs > to look for the one that has the same network as the gateway..(if > it's not p2p). e.g. if you have 10.2.2.2/24 and 10.3.3.3/24 on > an interface and the gateway is 10.3.3.1, then you obviously > need to select the second address on that interface. > I've been looking at this and it seems to me that it "falls out in the wash". It looks like in_pcbladdr() is what udp uses for this case and it just takes the rt_ifa->... as the address. It seems like there is a separate routing table entry for each address on an interface and that the search done by rtalloc() should get the correct one from what I can see. Does that make sense? Anyhow, thanks a lot for the help, rick