Add 127.0.0.1 -> ::1 conversion for IPv4-addressed IPv6 sockets

git-svn-id: file:///home/svn/framework3/trunk@6072 4d416f70-5f16-0410-b530-b9f4589650da
unstable
kris 2009-01-04 18:42:55 +00:00
parent 7a8cf33fc8
commit 754c1c5711
1 changed files with 4 additions and 0 deletions

View File

@ -91,6 +91,8 @@ class Rex::Socket::Comm::Local
if (local and local.length == 4)
if (local == "\x00\x00\x00\x00")
param.localhost = '::'
elsif (local == "\x7f\x00\x00\x01")
param.localhost = '::1'
else
param.localhost = '::ffff:' + Rex::Socket.getaddress(param.localhost)
end
@ -99,6 +101,8 @@ class Rex::Socket::Comm::Local
if (peer and peer.length == 4)
if (peer == "\x00\x00\x00\x00")
param.peerhost = '::'
elsif (peer == "\x7f\x00\x00\x01")
param.peerhost = '::1'
else
param.peerhost = '::ffff:' + Rex::Socket.getaddress(param.peerhost)
end