From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 10 14:16:19 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D8AB437B401 for ; Thu, 10 Jul 2003 14:16:19 -0700 (PDT) Received: from mx01.netapp.com (mx01.netapp.com [198.95.226.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A2E643FE0 for ; Thu, 10 Jul 2003 14:16:19 -0700 (PDT) (envelope-from kmacy@netapp.com) Received: from frejya.corp.netapp.com (frejya [10.10.20.91]) h6ALGIJo006422; Thu, 10 Jul 2003 14:16:18 -0700 (PDT) Received: from cranford-fe.eng.netapp.com (cranford-fe.eng.netapp.com [10.56.10.106])h6ALGIRa005988; Thu, 10 Jul 2003 14:16:18 -0700 (PDT) Received: from localhost (kmacy@localhost)h6ALGI507493; Thu, 10 Jul 2003 14:16:18 -0700 (PDT) Date: Thu, 10 Jul 2003 14:16:18 -0700 (PDT) From: Kip Macy To: Alin-Adrian Anton In-Reply-To: <3F0BDDC9.9080102@reversedhell.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: tcp raw socket programming recvfrom() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2003 21:16:20 -0000 Usually if your looking at raw packets you want to use BPF. -Kip On Wed, 9 Jul 2003, Alin-Adrian Anton wrote: > Hey folks, > > I wrote my piece of code to play with, and it uses raw sockets to send > TCP packets. It sends packets okay, everything tested with a sniffer, > everything is really really fine, but it seems I cannot recvfrom > anything. I mean, it just keeps waiting and doesn't see the reply the > server is actually sending (can be seen with a sniffer). I read that the > freebsd kernel does not duplicate any incoming TCP/UDP packets to any of > the opened raw sockets. Is that true? So the only solution is to use the > interface in promiscuous mode and sniff like a sniffer for the expected > packet? Is there any other way? > > PS: ICMP gets received well with recvfrom (tested). > > On Linux, it does work for tcp/udp too with recvfrom. > > > I was also wondering if anyone could help me understand why this > behaviour in freebsd? (or *BSD) > > Thanks! > > Best Regards, > Alin. > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >