tomaszmrugalski/dibbler — pull request #22 by Shine- (2014-06-17 20:57:28+00:00)
Title: Fix RENEW in Windows

This one corrects a bug in the Win32 port of the client:

After DHCP renewal, saving the renewed address or prefix fails. Windows will mark the address as "deprecated" after the original preferred lifetime has expired, effectively breaking IPv6 connectivity.

Reason: "netsh int ipv6 add address" will error out with "Object already exists" when using it on an existing address. Existing addresses can only be updated with "netsh int ipv6 set address".

This PR retries saving the address using "netsh int ipv6 set" in case "netsh int ipv6 add" fails. This is the safest approach, imo, because it will take care of re-adding OR renewing the address in both, ipaddr_add() and ipaddr_update().

Tested on Windows 2012R2 only, as that's the only box I have which is currently connected to an IPv6 network. Should work on anything XP or newer, though.