From owner-freebsd-net@FreeBSD.ORG Fri Aug 25 06:21:20 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org 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 03C0616A4DE; Fri, 25 Aug 2006 06:21:20 +0000 (UTC) (envelope-from fli+freebsd-net@shapeshifter.se) Received: from mx1.h3q.net (manticore.shapeshifter.se [212.37.5.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 795AB43D4C; Fri, 25 Aug 2006 06:21:19 +0000 (GMT) (envelope-from fli+freebsd-net@shapeshifter.se) Received: from localhost (localhost [127.0.0.1]) by mx1.h3q.net (Postfix) with ESMTP id 21AEA1A78D; Fri, 25 Aug 2006 08:21:17 +0200 (CEST) Received: from mx1.h3q.net ([127.0.0.1]) by localhost (mx1.h3q.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 42880-06; Fri, 25 Aug 2006 08:21:16 +0200 (CEST) Received: from [192.168.1.100] (217-208-33-252-o926.tbon.telia.com [217.208.33.252]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.h3q.net (Postfix) with ESMTP id F24941A751; Fri, 25 Aug 2006 08:21:15 +0200 (CEST) Message-ID: <44EE96D8.3040806@shapeshifter.se> Date: Fri, 25 Aug 2006 08:21:12 +0200 From: Fredrik Lindberg User-Agent: Thunderbird 1.5.0.4 (X11/20060727) MIME-Version: 1.0 To: Brooks Davis References: <44EE1F7B.5000500@shapeshifter.se> <20060824220314.GB40213@lor.one-eyed-alien.net> <44EE22E7.6000700@shapeshifter.se> <20060824223756.GC40213@lor.one-eyed-alien.net> In-Reply-To: <20060824223756.GC40213@lor.one-eyed-alien.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at h3q.net Cc: freebsd-net@freebsd.org, Pat Lashley , Doug Barton Subject: Re: Zeroconfig and Multicast DNS X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Aug 2006 06:21:20 -0000 Brooks Davis wrote: > On Fri, Aug 25, 2006 at 12:06:31AM +0200, Fredrik Lindberg wrote: >> Brooks Davis wrote: >>> It just occured to me that the daemon could handle this without any >>> interaction with dhclient or the static interface configuration. In the >>> mode where you only want an LLA if there isn't another address it's a >>> simple matter of watching the routing socket for messages and a) >>> removing the LLA if an IPv4 address other than 0.0.0.0 is configured on >>> the interface and b) (re)starting the process of obtaining an LLA when >>> all other addresses have been removed. The daemon should be listening >>> to the routing socket anyway because it should only run when the >>> interface has link which requires it to exit when the link goes down >>> similar to dhclient. I really need to go look at the code and see what >>> you're doing now. :) >> Well, I'm doing just that...except it's not the routing socket but the >> netdev filter of the kqueue system. Could be change to the routing >> socket. > > It looks like you'd need to switch to the routing socket to be able to > make decisions based on address changes, but the basic flow should be > the same. > It is doing decisions based on address changes... The difference is that instead of doing a read each time something arrives at the routing socket it just refreshes its data on whats on the interface when an address event takes place and then makes a descisions. Yes, you could see this as a potential race condition, but, it doesn't care if it was an address removal or address addition event that triggered it, it will do the same logic that should eliminate any race condition. However, I might change it to a routing socket anyway, haven't really decided yet. Fredrik Lindberg