kern/110199: Kqueue: kqueue_register doesn't update the knote flags (kn_flags)

Kapil Jain kapiltj at yahoo.com
Sun Mar 11 20:30:06 UTC 2007


>Number:         110199
>Category:       kern
>Synopsis:       Kqueue: kqueue_register doesn't update the knote flags (kn_flags)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 11 20:30:04 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Kapil Jain
>Release:        4.10, 6.1
>Organization:
Juniper networks
>Environment:
>Description:
      Kqueue_register should be initializing the kn_flags, but it doesn't.
This leads to a discrepancy between the kn_status flags and the kn_flags.

>How-To-Repeat:
      If you enable a read event and then disable it, the kn_flags will show the enable and kn_status disable.
>Fix:
      This patch may fix the problem.

Index: kern_event.c
===================================================================
RCS file: /cvs/junos-2001/src/sys/kern/kern_event.c,v
retrieving revision 1.4
diff -c -r1.4 kern_event.c
*** kern_event.c	14 Feb 2005 02:04:33 -0000	1.4
--- kern_event.c	11 Mar 2007 20:21:56 -0000
***************
*** 568,573 ****
--- 568,575 ----
  		goto done;
  	}
  
+         kn->kn_flags = kev->flags;
+ 
  	if ((kev->flags & EV_DISABLE) &&
  	    ((kn->kn_status & KN_DISABLED) == 0)) {
  		s = splhigh();

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list