From d56a50c49b31341a8d4f0530d30bb5c621418b20 Mon Sep 17 00:00:00 2001 From: Kieran Devlin Date: Mon, 7 Nov 2022 06:02:16 +0000 Subject: [PATCH] Sets the socket address family to the one decided by the address passed in. (#148) --- SMBLibrary/Client/SMB1Client.cs | 2 +- SMBLibrary/Client/SMB2Client.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SMBLibrary/Client/SMB1Client.cs b/SMBLibrary/Client/SMB1Client.cs index b4808eb..29ba4be 100644 --- a/SMBLibrary/Client/SMB1Client.cs +++ b/SMBLibrary/Client/SMB1Client.cs @@ -140,7 +140,7 @@ namespace SMBLibrary.Client private bool ConnectSocket(IPAddress serverAddress, int port) { - m_clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + m_clientSocket = new Socket(serverAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp); try { diff --git a/SMBLibrary/Client/SMB2Client.cs b/SMBLibrary/Client/SMB2Client.cs index 251709f..e79cfbb 100644 --- a/SMBLibrary/Client/SMB2Client.cs +++ b/SMBLibrary/Client/SMB2Client.cs @@ -145,7 +145,7 @@ namespace SMBLibrary.Client private bool ConnectSocket(IPAddress serverAddress, int port) { - m_clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + m_clientSocket = new Socket(serverAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp); try {