Roy Marples
2014-12-11 03:14:57 UTC
dhcpcd polls SIOCGNBRINFO_IN6 every second for every IPv6 router it
knows about to test neighbour reach-ability.
This isn't exactly optimal, hello battery drain.
Attached is a patch to add RTM_NEWNEIGH so that userland can react to
Neighbour Discovery changes, similar to the Linux equivalent.
It's designed to be protocol agnostic, (ie could be used for ARP as
well).
Currently, it only raises RTM_NEWNEIGH on IPv6 neighbour state and flag
(is it a router?) changes.
There is little point in generating RTM_DELNEIGH or RTM_GETNEIGH as
Linux does because our current
implementation sends equivalent messages via RTM_DELETE or RTM_CHANGE.
I have a patch for dhcpcd to use this (attached as well, needs my latest
fossil trunk, -current is too old).
The end result is that on NetBSD there are no longer any polls for state
- the kernel notifies every event change.
The only elephants left in the room are drivers that don't set IFF_UP
before LINK_STATE_UPi (hi sk(4)) and drivers which could set link state
but don't bother to (hi ppp(4)).
Comments, as always, are welcome.
Roy
knows about to test neighbour reach-ability.
This isn't exactly optimal, hello battery drain.
Attached is a patch to add RTM_NEWNEIGH so that userland can react to
Neighbour Discovery changes, similar to the Linux equivalent.
It's designed to be protocol agnostic, (ie could be used for ARP as
well).
Currently, it only raises RTM_NEWNEIGH on IPv6 neighbour state and flag
(is it a router?) changes.
There is little point in generating RTM_DELNEIGH or RTM_GETNEIGH as
Linux does because our current
implementation sends equivalent messages via RTM_DELETE or RTM_CHANGE.
I have a patch for dhcpcd to use this (attached as well, needs my latest
fossil trunk, -current is too old).
The end result is that on NetBSD there are no longer any polls for state
- the kernel notifies every event change.
The only elephants left in the room are drivers that don't set IFF_UP
before LINK_STATE_UPi (hi sk(4)) and drivers which could set link state
but don't bother to (hi ppp(4)).
Comments, as always, are welcome.
Roy