From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 25 08:52:32 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 C3E5516A4B3 for ; Sat, 25 Oct 2003 08:52:32 -0700 (PDT) Received: from mail.tacorp.net (mail.tacorp.net [208.20.58.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id CAFBB43FA3 for ; Sat, 25 Oct 2003 08:52:29 -0700 (PDT) (envelope-from raistlin@tacorp.net) Received: from mail.tacorp.net (raistlin@localhost [127.0.0.1]) by mail.tacorp.net (8.12.9/8.12.9) with ESMTP id h9PFwBfQ000698 for ; Sat, 25 Oct 2003 11:58:11 -0400 (EDT) (envelope-from raistlin@tacorp.net) Received: from localhost (raistlin@localhost)h9PFwAJY000695 for ; Sat, 25 Oct 2003 11:58:11 -0400 (EDT) X-Authentication-Warning: mail.tacorp.net: raistlin owned process doing -bs Date: Sat, 25 Oct 2003 11:58:10 -0400 (EDT) From: Jason Slagle To: freebsd-hackers@freebsd.org Message-ID: <20031025115710.Q647@mail.tacorp.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: PCAP Open BPF R/W? 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: Sat, 25 Oct 2003 15:52:32 -0000 Could someone consider applying the following to the in tree pcap? It makes it possible to write to the pcap fd to send packets out the interface. Some simulators expect this ability to properly do networking.. Jason --- pcap-bpf.c.old Sat Oct 25 11:56:32 2003 +++ pcap-bpf.c Sat Oct 25 11:49:10 2003 @@ -185,7 +185,7 @@ */ do { (void)snprintf(device, sizeof(device), "/dev/bpf%d", n++); - fd = open(device, O_RDONLY); + fd = open(device, O_RDWR); } while (fd < 0 && errno == EBUSY); /* -- Jason Slagle - CCNP - CCDP /"\ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \ / ASCII Ribbon Campaign . X - NO HTML/RTF in e-mail . / \ - NO Word docs in e-mail .