From owner-freebsd-net@FreeBSD.ORG Thu Aug 7 11:07:01 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 618E238D; Thu, 7 Aug 2014 11:07:01 +0000 (UTC) Received: from web01.jbserver.net (web01.jbserver.net [IPv6:2a00:8240:6:a::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25F39275C; Thu, 7 Aug 2014 11:07:01 +0000 (UTC) Received: from 18-132-17-190.fibertel.com.ar ([190.17.132.18] helo=[192.168.3.106]) by web01.jbserver.net with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.83) (envelope-from ) id 1XFLX9-0004Cg-8H; Thu, 07 Aug 2014 13:06:59 +0200 Message-ID: <53E35DA7.4020800@gont.com.ar> Date: Thu, 07 Aug 2014 07:06:15 -0400 From: Fernando Gont User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Hiroki Sato Subject: Re: Routing IPv6 packets towards oneself with routing sockets? References: <53E2B586.3080700@gont.com.ar> <20140807.192403.845244220459089560.hrs@allbsd.org> In-Reply-To: <20140807.192403.845244220459089560.hrs@allbsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 11:07:01 -0000 Hi, Hiroki, On 08/07/2014 06:24 AM, Hiroki Sato wrote: > > Fernando Gont wrote > in <53E2B586.3080700@gont.com.ar>: > > fe> However, whenever I lookup an entry for fc00:1::1 with routing sockets, > fe> the only entry I obtain is fc00:1::/64 (a network route) rather than > fe> fc00:1::1/128 (a host route). As a result, I kind of have to figure out > fe> that since fc00:1::1 is my own address, I must override whatever I > fe> learned via routing sockets, and just send my packets to loopback. > fe> > fe> I would assume that I must be doing something wrong, since I would > fe> expect the host-specific route (i.e. longest-matching route) to be route > fe> learned via routing sockets. And that I shouldn't be implementing this > fe> "is the dst address my own address?" hack. > fe> > fe> Any thoughts? > fe> > fe> P.S.: I can provide a code snippet if that'd be of any help. > > RTM_GET should return fc00:1::1/128 with ifp == lo0. Yes, that's what I would have expected. > Can you show > the code you are using? Yes: Run it as: bsd-lookup-simple -v IPV6_DEST_ADDR (or without the "-v" if you don't want much verbosity) Thanks! Best regards, -- Fernando Gont e-mail: fernando@gont.com.ar || fgont@si6networks.com PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1