summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-08-02 11:26:50 +0000
committerache <ache@FreeBSD.org>1995-08-02 11:26:50 +0000
commit4b4411611caeeafff898c141215294745b3bd998 (patch)
tree7f22a1924c12beafa49995f12e5c582e75747f8a /sys
parent80afbaa558c6d169718db78131fef10b41990429 (diff)
downloadFreeBSD-src-4b4411611caeeafff898c141215294745b3bd998.zip
FreeBSD-src-4b4411611caeeafff898c141215294745b3bd998.tar.gz
Back out predefined termios speeds check, it can cause troubles
with interaction pty <-> serial driver with non-standard speed. So, nothing protect us from garbadge in speed field, expect checking for < 0 left in tty.c :-(
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/tty_pty.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 4578d11..f8c6b00 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -71,11 +71,6 @@ struct pt_ioctl {
u_char pt_ucntl;
} pt_ioctl[NPTY]; /* XXX */
int npty = NPTY; /* for pstat -t */
-static int validspeed[] = {
- 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200,
- 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200
-};
-#define MAX_SPEED (sizeof(validspeed)/sizeof(*validspeed) - 1)
#define PF_PKT 0x08 /* packet mode */
#define PF_STOPPED 0x10 /* user told stopped */
@@ -649,32 +644,10 @@ ptyioctl(dev, cmd, data, flag, p)
case TIOCSETN:
#endif
case TIOCSETD:
- ndflush(&tp->t_outq, tp->t_outq.c_cc);
- break;
-
case TIOCSETA:
case TIOCSETAW:
- case TIOCSETAF: {
- register struct termios *t = (struct termios *)data;
- register int i;
-
- for (i = MAX_SPEED; i >= 0; i--)
- if (t->c_ispeed == validspeed[i])
- break;
- else if (t->c_ispeed > validspeed[i])
- return (EINVAL);
- if (i < 0)
- return (EINVAL);
- for (i = MAX_SPEED; i >= 0; i--)
- if (t->c_ospeed == validspeed[i])
- break;
- else if (t->c_ospeed > validspeed[i])
- return (EINVAL);
- if (i < 0)
- return (EINVAL);
-
+ case TIOCSETAF:
ndflush(&tp->t_outq, tp->t_outq.c_cc);
- }
break;
case TIOCSIG:
OpenPOWER on IntegriCloud