Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 support #39

Closed
GoogleCodeExporter opened this issue Apr 8, 2016 · 3 comments
Closed

IPv6 support #39

GoogleCodeExporter opened this issue Apr 8, 2016 · 3 comments

Comments

@GoogleCodeExporter
Copy link

ITerminalServicesSession.ClientIPAddress should be able to return an IPAddress 
when the underlying WinAPI function returns an IPv6 address.

Given that the IN6_ADDR structure via 
http://msdn.microsoft.com/en-us/library/ff554787%28v=VS.85%29.aspx is just a 
16-byte array, you can see that it's a simple modification. I believe this code 
would be sufficient to support this scenario and it works in my limited test 
case. (source: Impl\TerminalServicesSession.cs, function GetClientIPAddress, 
where the TODO comment is for this issue)

if (addressFamily == AddressFamily.InterNetwork)
{
   byte[] address = new byte[4];
   Array.Copy(clientAddress.Address, 2, address, 0, 4);
   return new IPAddress(address);
} else if(addressFamily == AddressFamily.InterNetworkV6) {
   byte[] address = new byte[16];
   Array.Copy(clientAddress.Address, 2, address, 0, 16);
   return new IPAddress(address);
}

Original issue reported on code.google.com by dan.libe...@gmail.com on 20 Dec 2010 at 11:47

@GoogleCodeExporter
Copy link
Author

Dan,

You're right that this would be a pretty simple modification -- the only other 
place that would need to be changed would be 
NativeMethodsHelper.QuerySessionInformationForEndPoint (admittedly not very 
DRY). The only reason I hadn't done it is that I hadn't set up IPv6 on a 
network yet for testing (see issue 17). But if it works for you, I'll apply the 
patch.

Original comment by danports on 21 Dec 2010 at 1:48

  • Changed state: Accepted
  • Added labels: Milestone-2.1, Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

I committed a fix for this in r111. Can you download the latest build from the 
build server 
(http://teamcity.codebetter.com/viewLog.html?buildId=25024&tab=artifacts&buildTy
peId=bt95 -- login as a guest) and verify that 
ITerminalServicesSession.ClientIPAddress and 
ITerminalServicesSession.RemoteEndPoint report the correct IPv6 results in your 
environment? Thanks.

Original comment by danports on 26 Apr 2011 at 10:56

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Issue 17 has been merged into this issue.

Original comment by danports on 15 Feb 2012 at 4:34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant