[comp.unix.questions] Help with SLIP

cmiller@sunspot.UUCP (Charlie Miller) (05/10/88)

Please respond is you have any idea that might help us with a problem
using SLIP.

The setup: VAX 750 4.3bsd running 7.1 (Berkeley 6/4/86) SLIP through
	   a terminal port on a dmf32 connected to a SUN 3/160 running
	   SUN OS 3.4 (4.2bsd) and the same SLIP with the SUN patches.

The problem: When rlogin-ed from the SUN to the VAX,  the connection
	     hangs and the user get automatically logged off the VAX.
	     There seems to be no pattern to the problem, connection
	     time might be 5 mins or it might work fine all day. Also,
	     rcp's work better if initiated from the VAX.

ANY help or suggestion will be appreciated.


========================================================================
-Charlie Miller	        Sittin' at 9500 feet...
USPS Mail:		National Solar Observatory, Sunspot, NM 88349
Phone:			(505)434-1390, FTS: 571-0238
UUCP:			{arizona,decvax,hao,ihnp4}!noao!sunspot!cmiller

chris@mimsy.UUCP (Chris Torek) (05/11/88)

Try the following patch on the 4.3BSD Vax.  Mike's CLISTRESERVE and my
SC_OACTIVE code clashed, so I simplified mine.

RCS file: RCS/if_sl.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -c2 -r1.1 -r1.2
*** /tmp/,RCSt1012706	Tue May 10 16:01:26 1988
--- /tmp/,RCSt2012706	Tue May 10 16:01:30 1988
***************
*** 21,25 ****
   */
  
! /* $Header: if_sl.c,v 1.1 87/04/05 08:59:39 chris Exp $ */
  /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
  
--- 21,25 ----
   */
  
! /* $Header: if_sl.c,v 1.2 87/09/03 09:47:01 chris Exp $ */
  /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
  
***************
*** 70,74 ****
  /* flags */
  #define	SC_ESCAPED	0x0001	/* saw a FRAME_ESCAPE */
- #define	SC_OACTIVE	0x0002	/* output tty is active */
  
  #define FRAME_END	 	0300		/* Frame End */
--- 70,73 ----
***************
*** 215,219 ****
  	}
  	IF_ENQUEUE(&ifp->if_snd, m);
! 	if ((sc->sc_flags & SC_OACTIVE) == 0) {
  		splx(s);
  		slstart(sc->sc_ttyp);
--- 214,218 ----
  	}
  	IF_ENQUEUE(&ifp->if_snd, m);
! 	if (sc->sc_ttyp->t_outq.c_cc == 0) {
  		splx(s);
  		slstart(sc->sc_ttyp);
***************
*** 235,239 ****
  	register int len;
  	register u_char *cp;
! 	int flush, nd, np, n, s;
  	struct mbuf *m2;
  	extern int cfreecount;
--- 234,238 ----
  	register int len;
  	register u_char *cp;
! 	int nd, np, n, s;
  	struct mbuf *m2;
  	extern int cfreecount;
***************
*** 260,265 ****
  		 * and we have something running already, stop here.
  		 */
! 		if (cfreecount < CLISTRESERVE + SLMTU &&
! 		    sc->sc_flags & SC_OACTIVE)
  			return;
  
--- 259,263 ----
  		 * and we have something running already, stop here.
  		 */
! 		if (cfreecount < CLISTRESERVE + SLMTU && tp->t_outq.c_cc > 0)
  			return;
  
***************
*** 270,280 ****
  		IF_DEQUEUE(&sc->sc_if.if_snd, m);
  		if (m == NULL) {
- 			if (tp->t_outq.c_cc == 0)
- 				sc->sc_flags &= ~SC_OACTIVE;
  			splx(s);
  			return;
  		}
- 		flush = !(sc->sc_flags & SC_OACTIVE);
- 		sc->sc_flags |= SC_OACTIVE;
  		splx(s);
  
--- 268,274 ----
***************
*** 284,288 ****
  		 * the line may have been idle for some time.
  		 */
! 		if (flush)
  			(void) putc(FRAME_END, &tp->t_outq);
  
--- 278,282 ----
  		 * the line may have been idle for some time.
  		 */
! 		if (tp->t_outq.c_cc == 0)	/* atomic */
  			(void) putc(FRAME_END, &tp->t_outq);
  
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris

cabo@tub.UUCP (Carsten Bormann) (05/13/88)

In article <11434@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes:
()   [...]
() ! /* $Header: if_sl.c,v 1.2 87/09/03 09:47:01 chris Exp $ */
()   [...]
()   		 * and we have something running already, stop here.
()   		 */
() ! 		if (cfreecount < CLISTRESERVE + SLMTU && tp->t_outq.c_cc > 0)
()   			return;

Nanu! (German word for sudden surprise.)
When I eyeballed the if_sl.c in the recent comp.bugs.4bsd.ucb-fixes
distribution a few days ago, I found the following revision string
(note the same author, the higher revision number and the older date):

() /* $Header: if_sl.c,v 1.12 85/12/20 21:54:55 chris Exp $ */

and the following bug:

()		/*
()		 * If system is getting low on clists
()		 * and we have something running already, stop here.
()		 */
()		if (cfreecount < CLISTRESERVE + SLMTU && tp->t_outq.c_cc == 0)
()			return;

Now I _really_ would like to know what is the definitive if_sl.c.
-- 
Carsten Bormann, <cabo@tub.UUCP> <cabo@db0tui6.BITNET> <cabo@tub.BITNET>
Communications and Operating Systems Research Group
Technical University of Berlin (West, of course...)	FAX: +49.30.31425156
Path: ...!pyramid!tub!cabo from the world, ...!unido!tub!cabo from Europe only.

chris@mimsy.UUCP (Chris Torek) (05/14/88)

In article <11434@mimsy.UUCP> I posted some diffs, including the following:
->! /* $Header: if_sl.c,v 1.2 87/09/03 09:47:01 chris Exp $ */

In article <490@tub.UUCP> cabo@tub.UUCP (Carsten Bormann) writes:
-Nanu! (German word for sudden surprise.)
-When I eyeballed the if_sl.c in the recent comp.bugs.4bsd.ucb-fixes
-distribution a few days ago, I found the following revision string
-(note the same author, the higher revision number and the older date):
-
->/* $Header: if_sl.c,v 1.12 85/12/20 21:54:55 chris Exp $ */

The revision numbers got out of sync when I re-set everything after
converting from 4.3BSD-beta to 4.3BSD-release.  if_sl 1.2 above is a
version with a fix I made shortly after the release.  (My own version
is now 1.5, but none of *those* changes are relevant.)

-and the following bug:
-
->		/*
->		 * If system is getting low on clists
->		 * and we have something running already, stop here.
->		 */
->		if (cfreecount < CLISTRESERVE + SLMTU && tp->t_outq.c_cc == 0)
->			return;

The 1.12 Berkeley version is wrong: obviously `we have something running'
means `tp->t_outq.c_cc != 0'.  The comment is right and the code is wrong
(for once!).  The version I sent to Berkeley was correct; Mike must have
edited it slightly....
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris