diff --git a/lib/rex/socket/comm/local.rb b/lib/rex/socket/comm/local.rb index 8278079bc3..c7d1af249e 100644 --- a/lib/rex/socket/comm/local.rb +++ b/lib/rex/socket/comm/local.rb @@ -39,11 +39,8 @@ class Rex::Socket::Comm::Local # Special-cased because of how different it is from UDP/TCP # def self.create_ip(param) - sock = ::Socket.open(::Socket::AF_INET, ::Socket::SOCK_RAW, ::Socket::IPPROTO_RAW) - - unless sock.getsockopt(::Socket::IPPROTO_IP, ::Socket::IP_HDRINCL) - sock.setsockopt(::Socket::IPPROTO_IP, ::Socket::IP_HDRINCL, true) - end + sock = ::Socket.open(::Socket::PF_INET, ::Socket::SOCK_RAW, ::Socket::IPPROTO_RAW) + sock.setsockopt(::Socket::IPPROTO_IP, ::Socket::IP_HDRINCL, 1) return sock if (param.bare?) diff --git a/lib/rex/socket/ip.rb b/lib/rex/socket/ip.rb index 2034656a6c..e7a61fc0e3 100644 --- a/lib/rex/socket/ip.rb +++ b/lib/rex/socket/ip.rb @@ -87,7 +87,7 @@ module Rex::Socket::Ip # Sends a datagram to the supplied host:port with optional flags. # def sendto(gram, peerhost, flags = 0) - dest = ::Socket.pack_sockaddr_in(1024, peerhost) + dest = ::Socket.pack_sockaddr_in(0, peerhost) send(gram, flags, dest) end