From 664363d7bd2d41f8c33abb6f629e8c73917adc6c Mon Sep 17 00:00:00 2001 From: HD Moore Date: Tue, 1 May 2007 04:50:16 +0000 Subject: [PATCH] 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 --- lib/rex/socket/comm/local.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/rex/socket/comm/local.rb b/lib/rex/socket/comm/local.rb index 0a45a38d49..76dfb0dcc6 100644 --- a/lib/rex/socket/comm/local.rb +++ b/lib/rex/socket/comm/local.rb @@ -64,11 +64,19 @@ class Rex::Socket::Comm::Local if (usev6) if (local and local.length == 4) - param.localhost = '::ffff:' + Rex::Socket.getaddress(param.localhost) + if (local == "\x00\x00\x00\x00") + param.localhost = '::' + else + param.localhost = '::ffff:' + Rex::Socket.getaddress(param.localhost) + end end if (peer and peer.length == 4) - param.peerhost = '::ffff:' + Rex::Socket.getaddress(param.peerhost) + if (peer == "\x00\x00\x00\x00") + param.peerhost = '::' + else + param.peerhost = '::ffff:' + Rex::Socket.getaddress(param.peerhost) + end end param.v6 = true