From owner-freebsd-net@freebsd.org Wed Mar 21 17:38:47 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D321BF572F4 for ; Wed, 21 Mar 2018 17:38:47 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118]) by mx1.freebsd.org (Postfix) with ESMTP id 6AD2E7CAD3 for ; Wed, 21 Mar 2018 17:38:46 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: from segfault-nmh-helo.tristatelogic.com (localhost [127.0.0.1]) by segfault.tristatelogic.com (Postfix) with ESMTP id DC7C53AEF2 for ; Wed, 21 Mar 2018 10:38:45 -0700 (PDT) From: "Ronald F. Guilmette" To: freebsd-net@freebsd.org Subject: Re: Raw Sockets: Two Questions In-Reply-To: <5AB1A9C5.9050707@grosbein.net> Date: Wed, 21 Mar 2018 10:38:45 -0700 Message-ID: <3394.1521653925@segfault.tristatelogic.com> X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2018 17:38:48 -0000 In message <5AB1A9C5.9050707@grosbein.net>, Eugene Grosbein wrote: >21.03.2018 3:09, Ronald F. Guilmette wrote: >> https://stackoverflow.com/questions/7048448/raw-sockets-on-bsd-operating-systems >> "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)." >> >> So, first question: Is the above comment actually true & accurate? > >Not for FreeBSD. Is it true for other *BSDs? >> 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)? > >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. Thank you. I will certainly look into this, however my needs are quite small and modest... probably so modest that a "convenience layer" wouldn't be a substantial help.