From owner-freebsd-hackers Wed Dec 13 06:16:30 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id GAA13460 for hackers-outgoing; Wed, 13 Dec 1995 06:16:30 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id GAA13440 for ; Wed, 13 Dec 1995 06:16:25 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id BAA23057; Thu, 14 Dec 1995 01:10:41 +1100 Date: Thu, 14 Dec 1995 01:10:41 +1100 From: Bruce Evans Message-Id: <199512131410.BAA23057@godzilla.zeta.org.au> To: eugen@rd.zgik.zaporizhzhe.ua, hackers@FreeBSD.ORG Subject: Re: bug or feature in kern/tty.c Cc: yura@rd.zgik.zaporizhzhe.ua Sender: owner-hackers@FreeBSD.ORG Precedence: bulk >I found strange thing in 2.1.0-RELEASE (and -current) in kern/tty.c. >When carrier was lossed then ttymodem() set TS_ZOMBIE and clear >TS_CONNECTED in tp->t_state. But TS_ZOMBIE is cleared only in ttioctl() >TIOCSETA* when line is setted to ignore modem status and when line is closed. POSIX says that (what I call the) zombie state remains until the line is closed. Clearing it when CLOCAL is raised is a special hack that helped very old (1.1.5) versions of slattach and perhaps other broken programs work right. >As result in ttymodem() after lossing carrier TS_CONNECTED is not setting >whithout reopening line or changing c_cflag to CLOCAL, and if this line >used for SLIP connection as result we have 'No route to host' error >when trying output to this line after modem reconnected. >Or is this bug in slattach ? slattach never set CLOCAL when it's working >with modem control and without redial cmd. Yes. slattach goes to a lot of trouble to close the line, but only for the redial_command case. The !redial_command case in sighup_handler() can't work for real SIGHUPs. In 1.1.5, the only way to close the line was to exit from the process. slattach goes to a lot of trouble to make itself the controlling process so that SIGHUPs get sent to it. The line can't be fully closed until it stops being a controlling terminal, and in 1.1.5 there was no way to stop it being a controlling terminal except to exit! :-( 2.x is better (TIOCSCTTY releases the previous control terminal, if any). Anyway, slattach still exits (in daemon() in aquire_line()) for the redial_command case. According to the man page, slattach aborts if it receives a SIGHUP in the !redial_command case. This got broken when complications to get rid of the controlling terminal were introduced. Bruce