Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpcap Open the BPF file descriptor as read-write. Som...



details:   https://anonhg.NetBSD.org/src/rev/ebef77b45ee4
branches:  trunk
changeset: 538417:ebef77b45ee4
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Oct 19 22:03:44 2002 +0000

description:
Open the BPF file descriptor as read-write.  Some pcap-using programs
(notably, simulators) expect to be able to send packets on the descriptor,
as well as receive.

diffstat:

 lib/libpcap/pcap-bpf.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f32bfd46a4af -r ebef77b45ee4 lib/libpcap/pcap-bpf.c
--- a/lib/libpcap/pcap-bpf.c    Sat Oct 19 20:33:17 2002 +0000
+++ b/lib/libpcap/pcap-bpf.c    Sat Oct 19 22:03:44 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcap-bpf.c,v 1.8 2002/09/22 16:13:01 thorpej Exp $     */
+/*     $NetBSD: pcap-bpf.c,v 1.9 2002/10/19 22:03:44 thorpej Exp $     */
 
 /*
  * Copyright (c) 1993, 1994, 1995, 1996
@@ -26,7 +26,7 @@
 static const char rcsid[] =
     "@(#) Header: pcap-bpf.c,v 1.29 96/12/31 20:53:40 leres Exp  (LBL)";
 #else
-__RCSID("$NetBSD: pcap-bpf.c,v 1.8 2002/09/22 16:13:01 thorpej Exp $");
+__RCSID("$NetBSD: pcap-bpf.c,v 1.9 2002/10/19 22:03:44 thorpej Exp $");
 #endif
 #endif
 
@@ -152,7 +152,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);
 
        /*



Home | Main Index | Thread Index | Old Index