*BSD News Article 94905


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!rill.news.pipex.net!pipex!tank.news.pipex.net!pipex!news.utell.co.uk!usenet
From: brian@shift.utell.net (Brian Somers)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: ppp -background never unloading
Date: 1 May 1997 17:04:06 GMT
Organization: Awfulhak Ltd.
Lines: 71
Message-ID: <5kaie6$a45@ui-gate.utell.co.uk>
References: <E9Gxnz.3IL@nonexistent.com>
Reply-To: brian@awfulhak.org, brian@utell.co.uk
NNTP-Posting-Host: shift.utell.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Newsreader: knews 0.9.8
To: "Jim Carroll" <jim@carroll.com>
Cc: brian@awfulhak.org
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:40116


[Posted and mailed]

In article <E9Gxnz.3IL@nonexistent.com>,
	"Jim Carroll" <jim@carroll.com> writes:
> 
> When I run my ppp session with the -background switch, after the modem
> drops 
> carrier, the PPP session is closed, but the ppp process never exits.  It
> stays loaded 
> with it's device lock in place.  This prevents subsequent ppp sessions from
> being able 
> to grab the modem.
> 
> I believe I have tracked down the problem to lcp.c., in the NewPhase()
> function.  The 
> function is made up of a switch block:
> 
> switch(phase) {
> 
> 	case PHASE_AUTHENTICATE:
> 		/* go through authentication logic */
> 
> 	case PHASE_NETWORK:
> 		/* bring up network connection */
> 
> 	case PHASE_DEAD:
> 		if (mode & MODE_DIRECT)
> 			Cleanup(EX_DEAD);
> 		break;
> 	}
> 
> Now, it seems to me this last case statement should also be checking to see
> if the 
> mode is background.  Otherwise, there seems to be no exit state that breaks
> out of 
> the DoLoop() in the main() method for the background mode.  Here is the
> suggested 
> change:
> 
> 	case PHASE_DEAD:
> 		if ((mode & MODE_DIRECT) || (mod & MODE_BACKGROUND))
> 			Cleanup(EX_DEAD);
> 		break;
> 
> I patched this is, and ppp now gives up the modem.

Excellent.  I'll update the sources.

> While I normally have no problem making source patches myself, I feel a
> little 
> squeemish about this one.  It seems alot of other people must have tried
> (and 
> successfully) run ppp in the background before.  Since I haven't seen
> anything in the 
> FAQ's, tutorials, or in this group, I have to assume I have missed
> something obvious.
> 
> I am running FreeBSD 2.2.1.
> 
> IJ-PPP, main SCCS version 1.22.2.7
> IJ-PPP, lcp SCCS version 1.10.2.1

This is my fault.  The -background flag didn't really work at all
'till just before 2.2.0 was released.  I guess I missed this
(*blush* - it's not exactly difficult to notice something's
going wrong, but I have lots of tun devices available....).

-- 
Brian <brian@awfulhak.org> <brian@freebsd.org>
      <http://www.awfulhak.org>
Don't _EVER_ lose your sense of humour !