From 6f875e8e4a32b0a3bb069d0aa05cf562224a7661 Mon Sep 17 00:00:00 2001 From: Chris Muench Date: Wed, 12 Nov 2025 16:19:17 -0800 Subject: [PATCH] Fix for unintentional DHCP reset --- .../NetworkInformation/NetworkInterface.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nanoFramework.System.Net/NetworkInformation/NetworkInterface.cs b/nanoFramework.System.Net/NetworkInformation/NetworkInterface.cs index 3c5e72f..2efceaa 100644 --- a/nanoFramework.System.Net/NetworkInformation/NetworkInterface.cs +++ b/nanoFramework.System.Net/NetworkInformation/NetworkInterface.cs @@ -209,8 +209,11 @@ public void EnableDhcp() { try { - _startupAddressMode = AddressMode.DHCP; - UpdateConfiguration((int)UpdateOperation.Dhcp); + if (_startupAddressMode != AddressMode.DHCP) + { + _startupAddressMode = AddressMode.DHCP; + UpdateConfiguration((int)UpdateOperation.Dhcp); + } } finally {