dhcpcd icon indicating copy to clipboard operation
dhcpcd copied to clipboard

Can't access $new_delegated_dhcp6_prefix in BOUND6 hook.

Open corvus1 opened this issue 3 years ago • 1 comments

I'd like to do some things in BOUND6 exit hook, for which it's necessary to know what prefix was just assigned to me. But for some reason, the $new_delegated_dhcp6_prefix variable is only available in the DELEGATED6 hook. And that's a bit inconvenient, because DELEGATED6 runs on renewal of the lease, but I only want to do those things if it's actually a new lease, new prefix, and things changed. Which can be once a month. But DELEGATED6 runs every half an hour or so.

So I had to resort to some hacks, to work out if the prefix has changed. But maybe I'm missing something, and there's a reasonable way to work out the new address in the BOUND6 exit hook?

corvus1 avatar Nov 18 '22 07:11 corvus1

I grep my dhcpcd.log for the string "delegated prefix". Really dirty but it works and my Docker containers have IPv6 access again when a new prefix was delegated by my router.

r2ixuz avatar Apr 17 '23 09:04 r2ixuz