From f79ed682073b96e0f5c8d97f026b08c3767cc47f Mon Sep 17 00:00:00 2001 From: sunbinzhu Date: Tue, 6 Feb 2018 17:24:02 +0800 Subject: [PATCH] Fix issue self assigned IP get synced Fix the issue that self assigned private IP get synced to linux nodes in v4sp5 --- LinuxCommunicator/HostsFile/HostsFileManager.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/LinuxCommunicator/HostsFile/HostsFileManager.cs b/LinuxCommunicator/HostsFile/HostsFileManager.cs index 87b6ec0..4f28297 100644 --- a/LinuxCommunicator/HostsFile/HostsFileManager.cs +++ b/LinuxCommunicator/HostsFile/HostsFileManager.cs @@ -144,6 +144,7 @@ public void ReloadTimerEvent(object param) if (ipEntryMatch.Success && manageByHPC && + !ipEntryMatch.Groups["ip"].Value.StartsWith(@"169.254") && ipEntryMatch.Groups["comment"].Value.Equals(HostsFileManager.ManagedEntryKey, StringComparison.OrdinalIgnoreCase) && HostEntry.TryCreate(ipEntryMatch.Groups["dnsName"].Value, ipEntryMatch.Groups["ip"].Value, out entry)) { @@ -203,10 +204,7 @@ protected virtual void Dispose(bool isDisposing) { if (isDisposing) { - if (this.reloadTimer != null) - { - this.reloadTimer.Dispose(); - } + this.reloadTimer?.Dispose(); } } }