On Thu, 14 Nov 2024 14:33:02 +1100
David Gibson
The default route a guest obtains via NDP has an expiry. We set this to the maximum allowed, 65535s (about 18 hours). We missed, however, that after that expiry, the guest won't send a new Router Solicitation. Instead it expects an unsolicited Router Advertisement to have come at some point before the expiry. This means that on an IPv6 setup, the default will disappear after 18 hours.
Correct this by sending unsolicited Router Advertisements as required by RFC 4861. Along the way we make a number of small cleanups to the NDP code.
Link: https://github.com/kubevirt/kubevirt/issues/13191
v2: * Some minor stylistic fixes * Use srandom() * Better explanation of the random requirements for the RAs
Applied. -- Stefano