One more fix for IPv6 support, this should fix things up for OS X

git-svn-id: file:///home/svn/framework3/trunk@4827 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2007-05-01 04:50:16 +00:00
parent a36a740cf0
commit 664363d7bd
1 changed files with 10 additions and 2 deletions

View File

@ -64,12 +64,20 @@ class Rex::Socket::Comm::Local
if (usev6) if (usev6)
if (local and local.length == 4) if (local and local.length == 4)
if (local == "\x00\x00\x00\x00")
param.localhost = '::'
else
param.localhost = '::ffff:' + Rex::Socket.getaddress(param.localhost) param.localhost = '::ffff:' + Rex::Socket.getaddress(param.localhost)
end end
end
if (peer and peer.length == 4) if (peer and peer.length == 4)
if (peer == "\x00\x00\x00\x00")
param.peerhost = '::'
else
param.peerhost = '::ffff:' + Rex::Socket.getaddress(param.peerhost) param.peerhost = '::ffff:' + Rex::Socket.getaddress(param.peerhost)
end end
end
param.v6 = true param.v6 = true
end end