dhcpv6: restart DHCPv6 on receipt of RA containing a new prefix
authorPaul Donald <[email protected]>
Tue, 18 Nov 2025 01:07:58 +0000 (02:07 +0100)
committerÁlvaro Fernández Rojas <[email protected]>
Tue, 18 Nov 2025 07:23:20 +0000 (08:23 +0100)
commit038407eca8a477da9b05ee7a9a7b6ac5fc837c8d
treee2274f547fea0309b28aee382c0459361a68334d
parentaf9968c0293fd2ca81edfc29575decb006cd73fc
dhcpv6: restart DHCPv6 on receipt of RA containing a new prefix

When the upstream DHCPv6 server does not provide IA_NA or IA_PD options, odhcp6c
enters into stateless mode, which will not be exited from until SIGUSR2 signal
is received.

This change enforces DHCPv6 restart on receipt of a RA that:
  a) advertises the presence of DHCPv6 server on the network, containing
  either M or O flags
  b) has a PI (prefix information) option that contains a new prefix

thus allowing the switch to DHCPv6 stateful mode when RA PI options suggest that
the upstream DHCPv6 server now manages a new prefix.

Restart is useful even when DHCPv6 client is already in stateful mode, so the
DHCPv6 server will be able to refresh the client's IA_NA and IA_PD options
before renewal timeout is triggered, hence avoiding the usage of potentially
deprecated addresses.

Signed-off-by: Alin Nastac <[email protected]>
Signed-off-by: Paul Donald <[email protected]>
Link: https://github.com/openwrt/odhcp6c/pull/119
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/dhcpv6.c
src/odhcp6c.c
src/odhcp6c.h
src/ra.c