diff options
author | dm <dm@cvs.openbsd.org> | 1997-08-13 20:29:42 +0000 |
---|---|---|
committer | dm <dm@cvs.openbsd.org> | 1997-08-13 20:29:42 +0000 |
commit | 467e43fd9f5184a25ed9b8bc7c77d16abdb793ba (patch) | |
tree | 2bca60cf62c1834b9e602e2d74436aad0b831963 /lib/libpcap/pcap-bpf.c | |
parent | 4ccfea81033f7de6fe05a29c45e81aec673a541b (diff) |
Fix PR #299 (pcap_inject busted).
Diffstat (limited to 'lib/libpcap/pcap-bpf.c')
-rw-r--r-- | lib/libpcap/pcap-bpf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libpcap/pcap-bpf.c b/lib/libpcap/pcap-bpf.c index 91234201596..d656a50e94f 100644 --- a/lib/libpcap/pcap-bpf.c +++ b/lib/libpcap/pcap-bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcap-bpf.c,v 1.7 1996/09/16 02:33:08 tholo Exp $ */ +/* $OpenBSD: pcap-bpf.c,v 1.8 1997/08/13 20:29:41 dm Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996 @@ -149,7 +149,9 @@ bpf_open(pcap_t *p, char *errbuf) */ do { (void)sprintf(device, "/dev/bpf%d", n++); - fd = open(device, O_RDONLY); + fd = open(device, O_RDWR); + if (fd < 0 && errno == EACCES) + fd = open(device, O_RDONLY); } while (fd < 0 && errno == EBUSY); /* |