diff options
Diffstat (limited to 'OpenSim/Framework/General')
-rw-r--r-- | OpenSim/Framework/General/Types/RegionHandle.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/OpenSim/Framework/General/Types/RegionHandle.cs b/OpenSim/Framework/General/Types/RegionHandle.cs index 409b05a..4a055ad 100644 --- a/OpenSim/Framework/General/Types/RegionHandle.cs +++ b/OpenSim/Framework/General/Types/RegionHandle.cs | |||
@@ -20,7 +20,10 @@ namespace OpenSim.Framework.Types | |||
20 | { | 20 | { |
21 | IPAddress addr = IPAddress.Parse(ip); | 21 | IPAddress addr = IPAddress.Parse(ip); |
22 | 22 | ||
23 | long baseHandle = addr.Address; | 23 | if (addr.AddressFamily != System.Net.Sockets.AddressFamily.InterNetwork) |
24 | throw new Exception("Bad RegionHandle Parameter - must be an IPv4 address"); | ||
25 | |||
26 | uint baseHandle = BitConverter.ToUInt32(addr.GetAddressBytes(), 0); | ||
24 | 27 | ||
25 | // Split the IP address in half | 28 | // Split the IP address in half |
26 | short a = (short)((baseHandle << 16) & 0xFFFF); | 29 | short a = (short)((baseHandle << 16) & 0xFFFF); |