From owner-freebsd-bugs Sat Oct 14 11:21:04 1995 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id LAA14528 for bugs-outgoing; Sat, 14 Oct 1995 11:21:04 -0700 Received: from gw.itfs.nsk.su (gw.itfs.nsk.su [193.124.36.33]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id LAA14518 for ; Sat, 14 Oct 1995 11:20:37 -0700 Received: from itfs.UUCP (uucp@localhost) by gw.itfs.nsk.su (8.6.12/8.6.12) with UUCP id AAA28928 for bugs@freebsd.org; Sun, 15 Oct 1995 00:20:12 +0600 Received: by itfs.nsk.su; Sun, 15 Oct 95 00:10:15 +0700 (NST) Received: (from daemon@localhost) by news.itfs.nsk.su (8.6.8/8.6.6) id AAA17850; Sun, 15 Oct 1995 00:01:20 +0600 From: nnd@itfs.nsk.su (Nickolay N. Dudorov) To: bugs@freebsd.org Subject: SLIP problem(s) in STABLE Message-ID: Date: Sat, 14 Oct 1995 18:01:09 GMT Sender: owner-bugs@freebsd.org Precedence: bulk It was already discovered that SLIP have some problems in -current. I found some (same ?) problems in -stable. 1) After succesfully establishing a SLIP connection by 'slattach' on a line with modem and loosing/reestablishing carrier I can't use that 'slX' interface due to permanent 'No route to host' messages. Reading the sources of /sys/net/if_sl.c and /sys/kern/tty.c shows that this message must results from: /* /sys/net/if_sl.c - lines from 446 */ if ((sc->sc_ttyp->t_state & TS_CONNECTED) == 0) { m_freem(m); return (EHOSTUNREACH); } which in turn is a result of (!)-marked lines in /* /sys/kern/tty.c - function ttymodem, lines from 1319 */ } else if (flag == 0) { /* * Lost carrier. */ CLR(tp->t_state, TS_CARR_ON); if (ISSET(tp->t_state, TS_ISOPEN) && ! !ISSET(tp->t_cflag, CLOCAL)) { ! SET(tp->t_state, TS_ZOMBIE); ! CLR(tp->t_state, TS_CONNECTED); if (tp->t_session && tp->t_session->s_leader) psignal(tp->t_session->s_leader, SIGHUP); ttyflush(tp, FREAD | FWRITE); return (0); } } else { /* * Carrier now on. */ SET(tp->t_state, TS_CARR_ON); ! if (!ISSET(tp->t_state, TS_ZOMBIE)) ! SET(tp->t_state, TS_CONNECTED); wakeup(TSA_CARR_ON(tp)); ttwakeup(tp); ttwwakeup(tp); } As a temporary "solution" ;-( of this problem I make the next change to /usr/src/sbin/slattach: --- slattach.c.STABLE Sat Oct 14 22:16:12 1995 +++ slattach.c Sat Oct 14 22:55:55 1995 @@ -419,6 +419,18 @@ } syslog(LOG_NOTICE, "Carrier now present on %s (sl%d)", dev, unit); + /* This HACK clears TS_ZOMBIE flag and set */ + /* TS_CONNECTED, which otherwise remains unset. */ + tty.c_cflag |= CLOCAL; + if (tcsetattr(fd, TCSANOW, &tty) < 0) { + syslog(LOG_ERR, "tcsetattr(TCSAFLUSH): %m"); + exit_handler(1); + } + tty.c_cflag &= ~CLOCAL; + if (tcsetattr(fd, TCSANOW, &tty) < 0) { + syslog(LOG_ERR, "tcsetattr(TCSAFLUSH): %m"); + exit_handler(1); + } } } setup_line(0); After that I can use my SLIP connection (and this is a kind of "correctness proof" of my problem analysis :-) 2) There are some "strangenesses(?)" in slattach behaviour - 'slX' interface marked as 'UP' even before carrier is established on a line; - is it really necessary to 'fork' (in 'acquire_line()') every time to run 'redial_cmd' (if there is any) ? - it seens to me than "resetting to tty discipline" in this 'acquire_line' can't be done when redialing because there is no carrier and switching to CLOCAL is done after that ? Unfortunely I have not enough time (and/or knowledges) to find answers to this questions (even in form of a HACKs) :-( N.Dudorov