Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net If we timeout waiting for data on the bpf device, al...



details:   https://anonhg.NetBSD.org/src/rev/f88537087ffc
branches:  trunk
changeset: 565771:f88537087ffc
user:      darrenr <darrenr%NetBSD.org@localhost>
date:      Tue Apr 20 10:51:09 2004 +0000

description:
If we timeout waiting for data on the bpf device, allow data in the current
storage buffer (bd_sbuf) to indicate that there is data present.

diffstat:

 sys/net/bpf.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 53b221e19336 -r f88537087ffc sys/net/bpf.c
--- a/sys/net/bpf.c     Tue Apr 20 08:48:03 2004 +0000
+++ b/sys/net/bpf.c     Tue Apr 20 10:51:09 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bpf.c,v 1.94 2004/04/15 14:56:57 darrenr Exp $ */
+/*     $NetBSD: bpf.c,v 1.95 2004/04/20 10:51:09 darrenr Exp $ */
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.94 2004/04/15 14:56:57 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.95 2004/04/20 10:51:09 darrenr Exp $");
 
 #include "bpfilter.h"
 
@@ -1102,7 +1102,10 @@
                    (d->bd_immediate && d->bd_slen != 0)) {
                        revents |= events & (POLLIN | POLLRDNORM);
                } else if (d->bd_state == BPF_TIMED_OUT) {
-                       revents |= events & POLLIN;
+                       if (d->bd_slen != 0)
+                               revents |= events & (POLLIN | POLLRDNORM);
+                       else
+                               revents |= events & POLLIN;
                } else {
                        selrecord(p, &d->bd_sel);
                        /* Start the read timeout if necessary */



Home | Main Index | Thread Index | Old Index