PCAP Open BPF R/W?

Jason Slagle raistlin at tacorp.net
Sat Oct 25 08:52:32 PDT 2003


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 .



More information about the freebsd-hackers mailing list