*BSD News Article 15104


Return to BSD News archive

Newsgroups: comp.os.386bsd.bugs
Path: sserve!newshost.anu.edu.au!munnari.oz.au!hp9000.csc.cuhk.hk!saimiri.primate.wisc.edu!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uxa.cso.uiuc.edu!rkb55989
From: rkb55989@uxa.cso.uiuc.edu (Rafal Boni)
Subject: [NetBSD] SLATTACH problems
Date: Mon, 26 Apr 1993 06:24:57 GMT
Summary: bad hacks! Beware!
Message-ID: <C62v5L.FJI@news.cso.uiuc.edu>
Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
Organization: University of Illinois at Urbana
Lines: 59

Howdee all..

	Since it was worked relatively nicely in 0.1 [except when running at
	2400 bps], I thought I would give the SLIP stuff in NetBSD a try..

	Didn't work... The problem seems to be that my modem wants the DTR 
	line high as a sign of good faith from the com port, while SLATTACH
	drops DTR [at least it did on my machine].  Depending on what my
	modem is set to it does one of three things on loss of DTR:

		(1) Hangs up and returns to command mode [the default, and what
			I had my modem set to do...]

		(2) Returns to command mode [this happened on my second try,
			since I have no manual for the modem and was remebering
			the commands not so accurately]

		(3) Ignores DTR drop

	Now it seemed to be that I shouldn't have to lobotomize my modem to
	deal with stuff like this, so I went looking in the code...
	
	What I discovered [again!] is that I ain't no kernel hacker, and 
	hence I came up with this brutal one line fix:


*** /usr/src/sbin/slattach/slattach.c	Wed Apr  7 23:15:29 1993
--- slattach.c	Mon Apr 26 00:56:27 1993
***************
*** 162,167 ****
--- 162,169 ----
		exit(1);
	}
					  
+ 	ioctl(fd, TIOCSDTR);
+ 

	cfsetispeed(&tty, speed);
	cfsetospeed(&tty, speed);
	if (tcsetattr(fd, TCSADRAIN, &tty) < 0) {

--------- END OF DIFF -------

	Let me know how much mileage you get out of this, and if there is a
	better way to fix this.... It seems that the problem is that the
	ioctl previous to my hack drops DTR, and I really don't know how to
	keep it from doing this....

	Any advice from kernel hackers appreciated, as is any advice from 
	anyone who has a nicer way to fix this...

							Rafal


/------------------------------------------------------------------------\
|Rafal Boni					       	  r-boni@uiuc.edu|
|"Me have a .sig?? I don't even have a clue!"	rkb55989@uxa.cso.uiuc.edu|
|                            -Anonymous      rb6775@caffeine.cen.uiuc.edu|
\------------------------------------------------------------------------/