Re: [tcpdump-workers] Losing BPF's

2007-02-20 Thread Guy Harris
maneeshs wrote: There seems to be a race condition in the above code, the check for the descriptor being free and the call to D_GET to mark the descriptor as being used is not atomic. So two closely spaced calls to bpfopen could cause bpf to use the same device twice ? Yes, if, in OpenBSD, e

Re: [tcpdump-workers] Losing BPF's

2007-02-20 Thread maneeshs
If so, then that open routine: int bpfopen(dev_t dev, int flag, int mode, struct proc *p) { struct bpf_d *d; /* create on demand */ if ((d = bpfilter_create(minor(dev))) == NULL) return (ENXIO); /* * Each minor can be opened by only one