Source-Changes-HG archive

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

[src/trunk]: src/sys/net from freebsd's kern/36219, the if expression in deci...



details:   https://anonhg.NetBSD.org/src/rev/008db9f46ef2
branches:  trunk
changeset: 565524:008db9f46ef2
user:      darrenr <darrenr%NetBSD.org@localhost>
date:      Sun Apr 11 01:41:01 2004 +0000

description:
from freebsd's kern/36219, the if expression in deciding whether or not
to return something check the value of bd_state in the wrong place.

diffstat:

 sys/net/bpf.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r fa61e224fa17 -r 008db9f46ef2 sys/net/bpf.c
--- a/sys/net/bpf.c     Sun Apr 11 00:44:47 2004 +0000
+++ b/sys/net/bpf.c     Sun Apr 11 01:41:01 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bpf.c,v 1.91 2004/04/10 23:31:51 darrenr Exp $ */
+/*     $NetBSD: bpf.c,v 1.92 2004/04/11 01:41:01 darrenr Exp $ */
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.91 2004/04/10 23:31:51 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.92 2004/04/11 01:41:01 darrenr Exp $");
 
 #include "bpfilter.h"
 
@@ -1083,10 +1083,10 @@
                 * An imitation of the FIONREAD ioctl code.
                 */
                if (d->bd_hlen != 0 ||
-                   ((d->bd_immediate || d->bd_state == BPF_TIMED_OUT) &&
-                    d->bd_slen != 0))
+                   ((d->bd_immediate && d->bd_slen != 0) ||
+                   d->bd_state == BPF_TIMED_OUT)) {
                        revents |= events & (POLLIN | POLLRDNORM);
-               else {
+               } else {
                        selrecord(p, &d->bd_sel);
                        /* Start the read timeout if necessary */
                        if (d->bd_rtout > 0 && d->bd_state == BPF_IDLE) {



Home | Main Index | Thread Index | Old Index