consistency fixes

git-svn-id: file:///home/svn/framework3/trunk@5596 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2008-07-25 06:04:51 +00:00
parent bb1db8253a
commit c6930f79f1
2 changed files with 3 additions and 6 deletions

View File

@ -39,11 +39,8 @@ class Rex::Socket::Comm::Local
# Special-cased because of how different it is from UDP/TCP # Special-cased because of how different it is from UDP/TCP
# #
def self.create_ip(param) def self.create_ip(param)
sock = ::Socket.open(::Socket::AF_INET, ::Socket::SOCK_RAW, ::Socket::IPPROTO_RAW) sock = ::Socket.open(::Socket::PF_INET, ::Socket::SOCK_RAW, ::Socket::IPPROTO_RAW)
sock.setsockopt(::Socket::IPPROTO_IP, ::Socket::IP_HDRINCL, 1)
unless sock.getsockopt(::Socket::IPPROTO_IP, ::Socket::IP_HDRINCL)
sock.setsockopt(::Socket::IPPROTO_IP, ::Socket::IP_HDRINCL, true)
end
return sock if (param.bare?) return sock if (param.bare?)

View File

@ -87,7 +87,7 @@ module Rex::Socket::Ip
# Sends a datagram to the supplied host:port with optional flags. # Sends a datagram to the supplied host:port with optional flags.
# #
def sendto(gram, peerhost, flags = 0) def sendto(gram, peerhost, flags = 0)
dest = ::Socket.pack_sockaddr_in(1024, peerhost) dest = ::Socket.pack_sockaddr_in(0, peerhost)
send(gram, flags, dest) send(gram, flags, dest)
end end