Re: PCAP Open BPF R/W?

2003-10-26 Thread John-Mark Gurney
Jason Slagle wrote this message on Sat, Oct 25, 2003 at 11:58 -0400:
 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..

You should probably add code to fall back to O_RDONLY if the O_RDWR
open fails incase an admin has sent read permissions on /dev/bpfX,
but not write for a group or something.

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 All that I will do, has been done, All that I have, has not.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


PCAP Open BPF R/W?

2003-10-25 Thread Jason Slagle

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 .

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]