From owner-freebsd-current@FreeBSD.ORG Tue Jul 25 20:58:55 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AECED16A504 for ; Tue, 25 Jul 2006 20:58:55 +0000 (UTC) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id 295B443D68 for ; Tue, 25 Jul 2006 20:58:43 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.18.229]) ([10.251.18.229]) by a50.ironport.com with ESMTP; 25 Jul 2006 13:58:43 -0700 Message-ID: <44C68602.50105@elischer.org> Date: Tue, 25 Jul 2006 13:58:42 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.13) Gecko/20060414 X-Accept-Language: en-us, en MIME-Version: 1.0 To: John-Mark Gurney References: <44C61470.3070005@shapeshifter.se> <20060725173924.GR96589@funkthat.com> In-Reply-To: <20060725173924.GR96589@funkthat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: Fredrik Lindberg , freebsd-current@freebsd.org Subject: Re: Extending EVFILT_NETDEV to support ip-address changes X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jul 2006 20:58:55 -0000 John-Mark Gurney wrote: >Fredrik Lindberg wrote this message on Tue, Jul 25, 2006 at 14:54 +0200: > > >>I have a suggestion to add support for ip-address changes to the >>kqueue (EVFILT_NETDEV) system. >>The infrastructure for EVFILT_NETDEV is already in place and this >>only introduce NOTE_NEWADDR and NOTE_DELADDR and minor modifications >>to the interface ioctl handler. >> >>The purpose is not to replicate the functionality of the >>routing socket, but to provide a low overhead mechanism for >>monitoring a given interface for address changes. >>No information about the event is sent through the kqueue system, >>instead it will be up to the caller to query the system (if wanted) >>to obtain information about the current state of the interface >>that is being monitored. >> >>I have attached a suggested patch, any thoughts? >> >> I may be wrong but doesn't an address change already trigger a routing socket event? > >Looks basicly good, though you will need to rethink how the filt_netdev >handles the hint.. since right now it just sets kn_data to whatever >hint is.. This is fine when it was simply one of NOTE_LINK{UP,DOWN,INV}, >but now that you have an extra flag, the NOTE_DELADDR could make an >app miss the LINK status if it was looking at data instead of fflags.. > >Plus, are you sure everyone that is using NOTE_LINK* are treating them >as a bit mask? maybe we need to redefine NOTE_LINK* as a mask plus set >of values, since each of the NOTE_LINK* can only be set once... but >the NOTE_ADDR{NEW,DEL} should probably be flags... > >We may want to reverse the naming to NOTE_ADDR{NEW,DEL} so that we have >the more generic first before the more specific... similar to NOTE_LINK*... > >Suffice it to say, this cannot be back ported to RELENG_6 due to API >breakage... > > >