> Am 14.10.2024 um 04:58 schrieb Chris Ross <cross+open...@distal.com>: > > > >> On Sep 3, 2024, at 16:48, Chris Ross <cross+open...@distal.com> wrote: >>> >>> >>> On Sep 3, 2024, at 10:28, Mike Fischer <fischer+o...@lavielle.com> wrote: >>> >>> There are two parts to this: >>> - The IPv6 prefix. >>> - The IID. >>> >>> The changes of the IPv6 prefix are generally triggered from the outside >>> (Internet provider). So here some mechanism to notify about changes would >>> be nice. > > Okay. Many weeks later and I have a related question. I’m away from the > “switching between routers” phase, and just have the one ever. But, the IPv6 > network it advertises can change when my upstream delegates me a new one (via > DHCPv6 IA_PD). > > Looking, I think devd will let me monitor for this in FreeBSD 14, but not 13, > and not other OSes. It looks like dhcpleasectl may be able to do this for me > in OpenBSD. But, I haven’t found anything portable. > > So, I’m looking into writing a daemon that can be notified when the IPv6 > network/address changes on an interface. But, I can’t yet find a portable > way. It looks like a PF_NETLINK socket can do this on FreeBSD and Linux, but > that is not available in OpenBSD (7.5). How can I register interest in the > address changes on a network interface in OpenBSD? Can this be done with > PF_LINK or PF_ROUTE? (Just thinking randomly) > > Obviously, polling is an option, but I’d rather be notified by the kernel > when I need to.
I think the suggestion made by Florian Obser earlier in this thread makes a lot of sense. And if you want to get away from scripting and directly interface with the notifications, the source code of the route(8) command would probably be a good place to look for how this is done. https://cvsweb.openbsd.org/src/sbin/route/ I’d be interested in what you come up with. Mike