mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
While waiting for the bpf hold buffer to become idle, check
the return value from mtx_sleep() and exit bpfread() on errors such as EINTR. Reviewed by: jhb
This commit is contained in:
parent
92981fdf9e
commit
d013d9022a
1 changed files with 7 additions and 2 deletions
|
|
@ -856,9 +856,14 @@ bpfread(struct cdev *dev, struct uio *uio, int ioflag)
|
|||
callout_stop(&d->bd_callout);
|
||||
timed_out = (d->bd_state == BPF_TIMED_OUT);
|
||||
d->bd_state = BPF_IDLE;
|
||||
while (d->bd_hbuf_in_use)
|
||||
mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock,
|
||||
while (d->bd_hbuf_in_use) {
|
||||
error = mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock,
|
||||
PRINET|PCATCH, "bd_hbuf", 0);
|
||||
if (error != 0) {
|
||||
BPFD_UNLOCK(d);
|
||||
return (error);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* If the hold buffer is empty, then do a timed sleep, which
|
||||
* ends when the timeout expires or when enough packets
|
||||
|
|
|
|||
Loading…
Reference in a new issue