Re: Extending EVFILT_NETDEV to support ip-address changes

From: John-Mark Gurney <gurney_j_at_resnet.uoregon.edu>
Date: Tue, 25 Jul 2006 10:39:24 -0700
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?

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...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."
Received on Tue Jul 25 2006 - 15:39:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:58 UTC