From owner-freebsd-net@FreeBSD.ORG Sat May 21 16:27:39 2005 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F1FD16A4CE for ; Sat, 21 May 2005 16:27:39 +0000 (GMT) Received: from web53905.mail.yahoo.com (web53905.mail.yahoo.com [206.190.36.215]) by mx1.FreeBSD.org (Postfix) with SMTP id 0512243D92 for ; Sat, 21 May 2005 16:27:39 +0000 (GMT) (envelope-from fetrovsky@yahoo.com) Received: (qmail 29479 invoked by uid 60001); 21 May 2005 16:27:38 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=RiApVC+LdM/S8DT4SLtC1n5tVrrLEDbElmy/xO38bCn9m1BWmJPRBosPaCc+x+ItwOgjMJUywcMod0rEcOZTXiYveaPxJf0pvInspp31qCDpVbARRx5yiceooCpie1UziZ3LmRDMPv/L4Fx9BCe0qA+aqk5P/zQFr0wCcOqenLk= ; Message-ID: <20050521162738.29477.qmail@web53905.mail.yahoo.com> Received: from [128.195.64.98] by web53905.mail.yahoo.com via HTTP; Sat, 21 May 2005 09:27:38 PDT Date: Sat, 21 May 2005 09:27:38 -0700 (PDT) From: Daniel Valencia To: freebsd-net@freebsd.org In-Reply-To: 6667 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: sending MAC packets --- again, and again X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2005 16:27:39 -0000 Hello and thanks for your prompt answer... I followed your (Jon Simola's) advice, so i defined BUFSIZ as 2000, although my tutorial said it was defined somewhere in the pcap headers, and added a pcap_loop instead of the pcap_next. I also modified the program to only show packets that are sent from a broadcast address and to a broadcast address (which is how i'm sending my packets). I can see almost all the packets I send. The issue is a little interesting, because I'd expect in a network with almost no trafic for my packets to show up immediately. Actually, at startup my sniffer stalls for a good minute and half, during which period some of the packets I send will show up and some will not, and after all the bunch is printed, it stalls again, while I keep putting messages in the wire from the other machine. After some more 60 seconds have passed, i see all of the messages appear all at once. Is this normal pcap behaviour, or is it some FreeBSD-specific behaviour, or is it just me? Thank you again - Daniel --- Jon Simola wrote: > On 5/20/05, Daniel Valencia > wrote: > > > my sniffer just stalls and eventually will report > a totally unrelated message. > ... > > handle = pcap_open_live( "xl0", BUFSIZ, 1, > 0, errbuf ); > > Uh, you're asking it to wait forever to see a > packet. I don't see a > #define in there for BUFSIZ, so you might be asking > it to catch zero > bytes. And what is the "totally unrelsated message"? > > I'd try using pcap_loop() or friends so you can > catch and examine more > than a single packet. > > And don't forget to call pcap_close() at the end, > I'm not sure how > polite pcap is about leaving dangling bpf devices. > > -- > Jon Simola > Systems Administrator > ABC Communications > Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html