Nmap Announce mailing list archives

Re: Socket type not supported..


From: Juan Cespedes <cespedes () lander es>
Date: Tue, 19 Jan 1999 15:15:02 +0100

On Tue, Jan 19, 1999 at 12:15:25AM +0100, Gigi Sullivan wrote:
Howdy to all ;)))

On Mon, Jan 18, 1999 at 04:27:19PM +0100, Juan Cespedes wrote:
On Fri, Jan 15, 1999 at 09:25:11PM +0100, Hroi Sigurdsson wrote:
SOCK_PACKET seems to have been completely deprecated in 2.2.0. There's
not even a mention of it in any of the toplevel files in /usr/src/linux.
So obviously nmap/libpcap-possibly-modified needs to be fixed? Will it
even be fixable when using the linux packet-filter?

    I don't know what does libpcap do (I don't have it handy), but
the correct way to open a socket for sending and receiving packets in
linux-2.1.* and linux-2.2.* is to do
            socket(PF_PACKET, SOCK_RAW, htons(0x0800))
instead of
            socket(PF_INET, SOCK_PACKET, htons(0x0800))

Sorry, but I don't agree w/ ya Juan.

Doing fd = socket(PF_INET, SOCK_RAW, htons(0x0800)) and the read(fd,...);
is a Linux feature.

        Read again: PF_PACKET, not PF_INET.  And it's not a Linux
feature; AFAIK, it's there in all the platforms with glibc-2 and
glibc-2.1.

Ok, I know that SOCK_PACKET is a linux feature too, but the concept is 
different.

        PF_PACKET,SOCK_RAW and PF_INET,SOCK_PACKET do exactly the same
thing, but the former is a GNU standard and the latter is Linux
specific.

-- 
Juan Cespedes


Current thread: