|
|
@ -399,12 +399,25 @@ func (m *windowsManager) Close() error {
|
|
|
|
// Windows DHCP client from sending dynamic DNS updates for our interface to
|
|
|
|
// Windows DHCP client from sending dynamic DNS updates for our interface to
|
|
|
|
// AD domain controllers.
|
|
|
|
// AD domain controllers.
|
|
|
|
func (m *windowsManager) disableDynamicUpdates() error {
|
|
|
|
func (m *windowsManager) disableDynamicUpdates() error {
|
|
|
|
if err := m.setSingleDWORD(winutil.IPv4TCPIPInterfacePrefix, "DisableDynamicUpdate", 1); err != nil {
|
|
|
|
prefixen := []winutil.RegistryPathPrefix{
|
|
|
|
|
|
|
|
winutil.IPv4TCPIPInterfacePrefix,
|
|
|
|
|
|
|
|
winutil.IPv6TCPIPInterfacePrefix,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for _, prefix := range prefixen {
|
|
|
|
|
|
|
|
k, err := m.openInterfaceKey(prefix)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if err := m.setSingleDWORD(winutil.IPv6TCPIPInterfacePrefix, "DisableDynamicUpdate", 1); err != nil {
|
|
|
|
defer k.Close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if err := k.SetDWordValue("DisableDynamicUpdate", 1); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := k.SetDWordValue("MaxNumberOfAddressesToRegister", 0); err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|