Subject: standards/3396: ttyinput() receives data when CREAD is not set
To: None <gnats-bugs@gnats.netbsd.org>
From: Klaus Klein <kleink@layla.inka.de>
List: netbsd-bugs
Date: 03/26/1997 14:53:21
>Number:         3396
>Category:       standards
>Synopsis:       ttyinput() receives data when CREAD is not set
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 26 10:05:01 1997
>Last-Modified:
>Originator:     Klaus Klein
>Organization:
private site
>Release:        970325
>Environment:
[mi]

>Description:
IEEE Std 1003.1-1988 section 7.1.2.4 (TTY, control modes) states:

 If CREAD is set, the receiver is enabled. Otherwise, no characters
 shall be received.

>How-To-Repeat:

>Fix:

Index: tty.c
===================================================================
RCS file: /cvsroot/netbsd/src/sys/kern/tty.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.7
diff -b -c -r1.1.1.1 -r1.1.1.1.2.7
***************
*** 229,234 ****
--- 229,240 ----
  	int i, error;
  
  	/*
+ 	 * Unless the receiver is enabled, drop incoming data.
+ 	 */
+ 	if (!ISSET(tp->t_cflag, CREAD))
+ 		return (0);
+ 
+ 	/*
  	 * If input is pending take it first.
  	 */
  	lflag = tp->t_lflag;
>Audit-Trail:
>Unformatted: