Date: Wed, 21 Mar 2018 01:03:02 +0000 From: Michael Tuexen <michael.tuexen@lurchi.franken.de> To: Eugene Grosbein <eugen@grosbein.net> Cc: "Ronald F. Guilmette" <rfg@tristatelogic.com>, freebsd-net@freebsd.org Subject: Re: Raw Sockets: Two Questions Message-ID: <FE503C2B-11C9-4937-8035-0793DCBFE177@lurchi.franken.de> In-Reply-To: <5AB1A9C5.9050707@grosbein.net> References: <98551.1521576540@segfault.tristatelogic.com> <5AB1A9C5.9050707@grosbein.net>
next in thread | previous in thread | raw e-mail | index | archive | help
> On 21. Mar 2018, at 00:39, Eugene Grosbein <eugen@grosbein.net> wrote: >=20 > 21.03.2018 3:09, Ronald F. Guilmette wrote: >=20 >> I'm going to be doing some stuff with raw sockets pretty soon, and >> while scrounging around, looking for some nice coding examples, I >> found the following very curious comment on one particular message >> board: >>=20 >> = https://stackoverflow.com/questions/7048448/raw-sockets-on-bsd-operating-s= ystems >>=20 >> "Using raw sockets isn't hard but it's not entirely portable. = For >> instance, both in BSD and in Linux you can send whatever you = want, >> but in BSD you can't receive anything that has a handler (like = TCP >> and UDP)." >>=20 >> So, first question: Is the above comment actually true & accurate? >=20 > Not for FreeBSD. Are you saying that I can receive on a raw socket SCTP, TCP and UDP = packets? Best regards Michael >=20 >> Second question: If the above assertion is actually true, then how = can >> nmap manage to work so well on FreeBSD, despite what would appear to = be >> this insurmountable stumbling block (of not being able to receive = replies)? >=20 > nmap uses libdnet that provides some portability layer, including RAW = socket operations. > It uses bundled stripped-down version but we have "normal" one as = net/libdnet port/package. > You should consider using it too as convenience layer. >=20 >=20 >=20 > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FE503C2B-11C9-4937-8035-0793DCBFE177>