Commit Graph

277 Commits

Author SHA1 Message Date
brian
941e2045a2 o Bump version to 1.3 to reflect major changes
o  Report modem connect time properly
o  Report bytes in/out over physical media
o  Fix phases (TERMINATE is *higher than* DEAD)
o  Do a LayerFinish from LcpDown
o  Bring down IPCP & CCP when we enter PHASE_TERMINATE
o  Give a new prompt when we go to PHASE_DEAD
o  Stop the modem timer properly when idle
o  Treat sig 15 like an exiting carrier loss
o  Log (DEBUG) offline & online transitions
1997-10-29 01:19:51 +00:00
brian
730654969b Cosmetic:
Move prototypes into the correct headers.
1997-10-26 12:42:13 +00:00
brian
486b8925ec Cosmetic (no functional changes):
o   Add missing $Id$s
o   Move extern decls from .c -> .h files
o   Staticize
o   Remove #includes from .h files
o   style(9)ify includes
o   bcopy -> memcpy
    bzero -> memset
    bcmp -> memcmp
    index -> strchr
    rindex -> strrchr
o   Move timeout.h -> timer.h (making it consistent w/ timer.c)
o   Add -Wmissing-prototypes
1997-10-26 01:04:02 +00:00
brian
5edc0d2f34 sleep => nointr_sleep
usleep => nointr_usleep
(not just a #define)
Already done by: ache
1997-10-24 22:36:31 +00:00
ache
2ac9673aae Restore back non-interruptable sleep/usleep just redefine them to not
mix with standard library functions
1997-10-23 21:32:48 +00:00
ache
39156922f6 Remove private sleep/usleep hacks 1997-10-23 20:11:01 +00:00
brian
b8215996d7 Fix various filter problems
PR:		4727
Submitted by:	Chiharu Shibata <chi@bd.mbn.or.jp>
1997-10-23 10:09:35 +00:00
brian
9060aacb1c Fix HDLC logging (actually LogDumpBp()). It was only
outputting the first mbuf in the chain.
1997-10-22 01:22:51 +00:00
brian
b066166467 Ask for VJ slot id compression by default. 1997-10-17 00:20:30 +00:00
brian
d134eaa71d cosmetic:
o  Log client connection commands when "set log +command"
o  Don't display PAP password in the log unless we're
   "set log +debug".
1997-10-16 23:55:19 +00:00
brian
d651f50b27 Initialise LCP, IPCP and CCP as soon as LCP is down.
Without this, in -auto mode, we stay in ST_STOPPING
and never check our dial filters to see if it's time
to bring the line up again.

This may make "set stopped" redundant.
1997-10-15 01:01:17 +00:00
brian
6643d67546 Un-spam ip_sum (arrgh - I don't know how this made
it into my patches :()
1997-10-12 21:43:55 +00:00
brian
be5e3ab6be Cosmetic: Mention that ppp is suspending before
executing a "shell" command.
1997-10-12 01:49:37 +00:00
brian
5d5b867579 Support VJ maximum slot identifiers != 15.
Support VJ slot id compression.

Previously, ppp would negotiate a max slot between 2 & 15
(if asked), and would agree to slot id compression (if asked).
It would then proceed to use 16 slots and no compression
anyway.  The result was a rather unusable connection.
1997-10-07 00:56:58 +00:00
brian
e5021654d0 Change things around a bit when bringing down the layers.
o LcpLayerDown() no longer does a NewPhase(PHASE_TERMINATE).
  Instead, it's done in LcpLayerFinish().  LayerFinish() gets
  called by the FSM after the LCP FSM goes through the Stopping
  and Stopped states.

o -direct and -background mode exit at PHASE_TERMINATE, not
  PHASE_DEAD.

The result is that LCP, CCP & IPCP are brought down cleanly on both
sides of the link (not just our side).  Killing ppp rather than just
closing it still makes it get out after the LCP SendTerminateReq().
I'll have a look at that soon.  We're probably not actually sending
the REQ :-(
1997-10-05 15:00:10 +00:00
brian
1f236d536d Refer a bit to pppctl.
Suggested (far to subtly for his own good) by:	joerg
1997-10-05 14:27:08 +00:00
brian
c627948926 Cosmetic: Be specific about using TABs in syslog.conf. 1997-10-05 10:29:32 +00:00
brian
56229906e0 Cosmetic: Log a strerror(errno) when failing to write to
the tun device.
1997-10-04 00:14:39 +00:00
brian
4ab28dc74b If "set mtu" is used, *and* the mtu is less than the
value requested by the peer, NAK using this value
rather than silently just changing the interface
mtu.
1997-09-29 19:40:16 +00:00
brian
4ffbb78e97 Test for the existence of ../../secure rather
than /usr/include/des.h before building with MSChap.
support.  Also allow -DNOCRYPT (as well as -DNOSECURE)
as an override
sbin/init example pointed out by: bde
1997-09-28 20:17:59 +00:00
brian
889a2eb5e6 Don't depend on time.h including sys/types.h 1997-09-27 19:41:40 +00:00
brian
eba31c6066 Don't login twice when using passwdauth
Suggested by:	Peter Childs <pjchilds@imforei.apana.org.au>
Merge the whole module into a few lines in pap.c
1997-09-27 19:11:43 +00:00
brian
72603302dc #define RECON_ENVOKED as 4 (not 3, like RECON_UNKNOWN)
Pointed out by:	tom@tomqnx.com (Tom Torrance at home)
1997-09-26 00:23:36 +00:00
brian
a54a976476 Do the MSChap encryption.
Submitted by:	Gabor Kincses <gabor@acm.org>
1997-09-25 00:58:20 +00:00
brian
4c4910184f Allow Microsoft CHAP authentication.
This is a combination of MD4 & DES.
Submitted by:	Gabor Kincses <gabor@acm.org>
1997-09-25 00:52:37 +00:00
brian
c73c4cd778 Don't luse uu_lock in -direct mode. It conflicts w/
hylafax & the like.
Get the CD bit right at last - now that I've got
my second modem back - loss of carrier makes ppp exit.
1997-09-23 22:07:51 +00:00
brian
8403100dd5 Undo botched commit (local changes got in) 1997-09-23 19:52:14 +00:00
brian
3884570228 Don't allow accept/deny when it's not appropriate.
Log PAP/CHAP users in utmp & wtmp, allowing it to
be avoided with "disable utmp"
1997-09-22 23:59:16 +00:00
brian
e74401cd50 Don't pause for one second before starting LCP
negotiation.  Instead, incrementally pause after
receiving LCPs with the same magic.  We can now
suffer a server that waits more than 1 second before
responding.  Pauses greater than a second get
hopelessly confusing as when the server eventually
starts, it sees a flood of Config Requests followed
by config NAKs and changes of magic.  This causes the
server to change its magic over and over.....
1997-09-22 02:51:24 +00:00
brian
ed62efbf2d Use the correct device name in "show modem" 1997-09-22 00:55:46 +00:00
brian
5e4ed6c854 Correct the way the uucp lock file and the ttyXX.if lock
file get created.  We don't create lock files over non-tty
connections, but we *do* create lock files in -direct mode.
This leaves us capable of adding utmp/wtmp support for
successful pap & chap logins (coming soon).
1997-09-22 00:46:56 +00:00
brian
2a712aab9b Sleep for a second before sending the first LCP
config request.  This stops us from squirting stuff
down a line that still has ECHO turned on because the
peer hasn't had a chance to start yet.
Lead to the cause by:	Greg Lehey <grog@lemis.com>
1997-09-21 23:01:34 +00:00
brian
89c06caf59 It turns out that the following:
close(1);
  close(2);
  x = open(ctermid(NULL), O_RDWR|O_NONBLOCK);
  close(0)
on a tty causes select() to return an exception for descriptor x !
This is the case in RELENG_2_2, but not in 2.2.2.  I'm not sure why.
Instead of doing the x=open() and close(0), we just do x=0 now.
Problem pointed out by: Greg Lehey <grog@lemis.com>
                        Tomi Vainio <tomppa@fidata.fi>
1997-09-21 20:26:47 +00:00
brian
2f99a3221a Typo police
Submitted by:	Mark Cammidge <mark@gmtunx.ee.uct.ac.za>
1997-09-21 13:08:00 +00:00
brian
131579bb6f Add a pppctl(8) xref.
Suggested by:	joerg
1997-09-21 13:06:43 +00:00
brian
109ba0ca66 Don't close(1) in direct mode and then proceed to
isatty(1) !  Keep 0 open for this till the modem's
been set up by either dup()ing 0 or by opening
ctermid(NULL) (if isatty(0)).

Discussed problem with: Tomi Vainio <tomppa@fidata.fi>
Made it finally dawn on me: Angelo Turetta <ATuretta@stylo.it>
1997-09-18 00:15:25 +00:00
brian
af684d2595 Support CHAP using MD4
Suggested by: jordan
1997-09-17 23:17:57 +00:00
brian
aaae64c991 o Fix two unlikely descriptor leaks.
o Output the correct device for "show modem"
  while in -direct mode.
o Cosmetic:  Moan a bit more when we can't open
  the [modem] device.
o Call OpenModem() in a more "natural" way.
o Add some LogDEBUG in OpenModem().
1997-09-16 23:15:16 +00:00
brian
93e97af991 Get rid of missing-prototype-warning 1997-09-10 23:55:35 +00:00
brian
5d60a9a46b PRED1 => TY_PRED1 (oops) 1997-09-10 21:36:54 +00:00
brian
49b883a1dd o Initialize the PRED1 input queue when we
receive the ResetAck, NOT when we send the
   ResetReq (as per the rfc).
o  SILENTLY ignore CCPs that arrive *before*
   the network phase (as per the rfc).
o  Check that we've actually negotiated PRED1
   before sending PRED1 output.
   This bug has been around for a *VERY* long
   time !  We shouldn't need to explicitly disable
   PRED1 now :-)
1997-09-10 21:33:32 +00:00
brian
74b863965c Cosmetic: Remove unused variables and build on OpenBSD. 1997-09-10 02:20:35 +00:00
brian
2acb5315cb Allow dial to work in non-interactive mode. 1997-09-09 23:56:29 +00:00
brian
2c906ef2d4 Print errors correctly (don't adjust
argc/argv for commands).
1997-09-09 23:23:24 +00:00
brian
fab65993a1 Don't start an interactive shell from a
telnet prompt.
1997-09-09 23:13:31 +00:00
brian
0791c3c050 Correct ppp authentication defaults in interactive
mode.  We don't want to be forced to type a password
here :-(
Pointed out by: mouth@ibm.net (John Kelly)

While I'm there, don't allow a "set server" in
interactive mode.
1997-09-09 21:51:39 +00:00
brian
4939f4fc06 Document the use of PAP/CHAP properly. 1997-09-09 21:01:53 +00:00
brian
f35ea9c661 Disable LQR by default. It causes too many problems
with too many ISPs to be a good default.  LQR is still
accepted by default.
1997-09-07 01:00:06 +00:00
brian
1a2595c181 Use __libalias_version to derive the name to
pass to dlopen().
1997-09-06 11:16:02 +00:00
brian
01052674bd Install as group ``network''
Insist that uid == 0 for client ppp
Disallow client sockets if no password is specified
Don't exit on failure to open client socket for listening
Allow specification of null local password
Use reasonable size (smaller) ``vector''s in auth.c
Fix "passwd ..." usage message
Insist on "all" as arg to "quit" (if any)
Drop client socket connection before Cleanup() when "quit all"
1997-09-04 00:38:22 +00:00