From 9747d9caefad1dc760aed67744ef6107c66e27af Mon Sep 17 00:00:00 2001 From: Gert Driesen Date: Fri, 30 Dec 2016 13:14:35 +0100 Subject: [PATCH] Revert "Add ClientIP to client info to allow select client IP that should be used for connection (#132)" This reverts commit 78679a3c30e689aeb2ad8990aa4db6d71b48db99. --- src/Renci.SshNet/ConnectionInfo.cs | 70 ------------------------------ src/Renci.SshNet/Session.cs | 2 +- 2 files changed, 1 insertion(+), 71 deletions(-) diff --git a/src/Renci.SshNet/ConnectionInfo.cs b/src/Renci.SshNet/ConnectionInfo.cs index 6e13755a..ba8f38b9 100644 --- a/src/Renci.SshNet/ConnectionInfo.cs +++ b/src/Renci.SshNet/ConnectionInfo.cs @@ -9,7 +9,6 @@ using Renci.SshNet.Common; using Renci.SshNet.Messages.Authentication; using Renci.SshNet.Security.Cryptography.Ciphers.Modes; using Renci.SshNet.Security.Cryptography.Ciphers; -using System.Net; namespace Renci.SshNet { @@ -206,14 +205,6 @@ namespace Renci.SshNet /// public string ClientVersion { get; internal set; } - /// - /// Gets the client ip to use for connection when client has multiple IP addresses availble. - /// - /// - /// The client ip to use for connection. - /// - public IPAddress ClientIP { get; internal set; } - /// /// Gets the current client compression algorithm. /// @@ -272,66 +263,6 @@ namespace Renci.SshNet /// is null. /// No specified. public ConnectionInfo(string host, int port, string username, ProxyTypes proxyType, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword, params AuthenticationMethod[] authenticationMethods) - : this(host, DefaultPort, username, null, ProxyTypes.None, null, 0, null, null, authenticationMethods) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The host. - /// The username. - /// The client IP to be used. - /// The authentication methods. - /// is null. - /// is a zero-length string. - /// is a zero-length string. - /// is null. - /// is a zero-length string. - public ConnectionInfo(string host, string username, IPAddress clientIP, params AuthenticationMethod[] authenticationMethods) - : this(host, DefaultPort, username, clientIP, ProxyTypes.None, null, 0, null, null, authenticationMethods) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The host. - /// The port. - /// The username. - /// The client IP to be used. - /// The authentication methods. - /// is null. - /// is null, a zero-length string or contains only whitespace characters. - /// is not within and . - /// is null. - /// is null, a zero-length string or contains only whitespace characters. - public ConnectionInfo(string host, int port, string username, IPAddress clientIP, params AuthenticationMethod[] authenticationMethods) - : this(host, port, username, clientIP, ProxyTypes.None, null, 0, null, null, authenticationMethods) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// Connection host. - /// Connection port. - /// Connection username. - /// The client IP to be used. - /// Type of the proxy. - /// The proxy host. - /// The proxy port. - /// The proxy username. - /// The proxy password. - /// The authentication methods. - /// is null. - /// is null, a zero-length string or contains only whitespace characters. - /// is not within and . - /// is not and is null. - /// is not and is not within and . - /// is null. - /// No specified. - public ConnectionInfo(string host, int port, string username, IPAddress clientIP, ProxyTypes proxyType, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword, params AuthenticationMethod[] authenticationMethods) { if (host == null) throw new ArgumentNullException("host"); @@ -455,7 +386,6 @@ namespace Renci.SshNet Host = host; Port = port; Username = username; - ClientIP = clientIP; ProxyType = proxyType; ProxyHost = proxyHost; diff --git a/src/Renci.SshNet/Session.cs b/src/Renci.SshNet/Session.cs index 0bebddfc..e2674309 100644 --- a/src/Renci.SshNet/Session.cs +++ b/src/Renci.SshNet/Session.cs @@ -1600,7 +1600,7 @@ namespace Renci.SshNet /// An error occurred trying to establish the connection. private void SocketConnect(string host, int port) { - var ipAddress = ConnectionInfo.ClientIP ?? DnsAbstraction.GetHostAddresses(host)[0]; + var ipAddress = DnsAbstraction.GetHostAddresses(host)[0]; var ep = new IPEndPoint(ipAddress, port); DiagnosticAbstraction.Log(string.Format("Initiating connection to '{0}:{1}'.", host, port));