Re: TCP Broken

Linus Torvalds (torvalds@transmeta.com)
4 Mar 1997 18:43:08 GMT


In article <Pine.LNX.3.91.970304093541.109A-100000@chaos.analogic.com>,
Richard B. Johnson <root@analogic.com> wrote:
>Linux version 2.1.28 has the IP Interface broken. Outgoing telnet, rlogin,
>and rsh work. Incomming do not. Leading characters missing per line on
>telnet with no echo. Outgoing strings has the first two bytes missing on
>every buffered line, etc.

It's not TCP, it's the tty layer. A _very_ silly bug indeed, patches
follow. Anything which tries to use packet mode breaks without this
patch,

Linus

-----
diff -u --recursive --new-file v2.1.28/linux/drivers/char/tty_ioctl.c linux/drivers/char/tty_ioctl.c
--- v2.1.28/linux/drivers/char/tty_ioctl.c Tue Mar 4 10:25:23 1997
+++ linux/drivers/char/tty_ioctl.c Tue Mar 4 10:18:16 1997
@@ -503,13 +503,16 @@
(real_tty->termios_locked,
(struct termios *) arg);
case TIOCPKT:
+ {
+ int pktmode;
+
if (tty->driver.type != TTY_DRIVER_TYPE_PTY ||
tty->driver.subtype != PTY_TYPE_MASTER)
return -ENOTTY;
- retval = get_user(retval, (int *) arg);
+ retval = get_user(pktmode, (int *) arg);
if (retval)
return retval;
- if (retval) {
+ if (pktmode) {
if (!tty->packet) {
tty->packet = 1;
tty->link->ctrl_status = 0;
@@ -517,6 +520,7 @@
} else
tty->packet = 0;
return 0;
+ }
/* These two ioctl's always return success; even if */
/* the driver doesn't support them. */
case TCSBRK: case TCSBRKP:
-----