From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 8 01:09:45 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 5FC1116A4E9 for ; Mon, 8 Sep 2003 01:09:45 -0700 (PDT) Received: from smtp.netli.com (ip2-pal-focal.netli.com [66.243.52.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D3CF43FB1 for ; Mon, 8 Sep 2003 01:09:44 -0700 (PDT) (envelope-from vlm@netli.com) Received: (qmail 10487 invoked by uid 84); 8 Sep 2003 08:09:44 -0000 Received: from vlm@netli.com by l3-1 with qmail-scanner-0.96 (uvscan: v4.1.40/v4121. . Clean. Processed in 0.147954 secs); 08 Sep 2003 08:09:44 -0000 Received: from unknown (HELO netli.com) (172.17.1.12) by mx01-pal-lan.netli.lan with SMTP; 8 Sep 2003 08:09:44 -0000 Message-ID: <3F5C39B3.2010001@netli.com> Date: Mon, 08 Sep 2003 01:11:31 -0700 From: Lev Walkin Organization: Netli, Inc. User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030820 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: Dmitry Morozovsky References: <20030907233940.M18589@woozle.rinet.ru> <3F5BB991.2050601@netli.com> <20030908113632.R55683@woozle.rinet.ru> <3F5C3549.8050607@netli.com> <20030908120036.V55683@woozle.rinet.ru> In-Reply-To: <20030908120036.V55683@woozle.rinet.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: hackers@freebsd.org Subject: Re: if bpf fd's select()able? 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: Mon, 08 Sep 2003 08:09:45 -0000 Dmitry Morozovsky wrote: > On Mon, 8 Sep 2003, Lev Walkin wrote: > > [snip] > > LW> > LW> Yes, you're missing the interactive mode. > LW> > LW> Refer to BIOCIMMEDIATE in the bpf(4) manual page. > LW> > > LW> > Unfortunately not ;-) > LW> > LW> Fortunately, yes. > LW> > LW> > if (ioctl(fd, BIOCPROMISC, NULL) == -1) > LW> > err(1, "can't set promisc mode"); > LW> > if (ioctl(fd, BIOCIMMEDIATE, &yes) == -1) > LW> > err(1, "can't set IMMEDIATE mode"); > LW> > LW> Are you sure that "yes" variable holds the truth value? > > Yes. Just attaching file from wrong directory. > > However, I found a (really stupid, yeah) bug: the first parameter of select() > in this test case should be fd+1, not 1 ;-) Unfortunately, this could not possibly be the case, if your system's documentation is in sync with the reality: === select(2) === For historical reasons, select() will always examine the first 256 descriptors. === cut === -- Lev Walkin vlm@netli.com