Commit Graph

1563 Commits

Author SHA1 Message Date
Brian Somers
c63c8e7638 Call MSCHAP CHAP80 in ``show lcp'' so that it's consistent with CHAP81. 2000-11-29 15:47:35 +00:00
Brian Somers
17aa4afba3 Use only the bit after the ``\'' when hashing the challenge in
MSChapv2

Submitted by: Ustimenko Semen <semen@iclub.nsu.ru>
2000-11-28 22:50:40 +00:00
Brian Somers
94d7be5294 Add ``enable/disable tcpmssfixup'', defaulting to enabled.
Suggested by:	julian
Hijacked from:	ru (ports/net/tcpmssd)
2000-11-28 13:18:35 +00:00
Ben Smithurst
aa11a6dde4 various typo and minor punctuation changes.
PR:		23111
Submitted by:	Jimmy Olgeni <olgeni@uli.it>
2000-11-28 11:35:14 +00:00
Ruslan Ermilov
e97407b4f2 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 20:10:44 +00:00
Brian Somers
b43607b7f2 Some gratuitous whitespace changes. 2000-11-19 16:58:59 +00:00
Brian Somers
a080fda810 Describe how to tunnel properly.
Requested by: Greg Quinlan <greg@macquarrie.com.au>
2000-11-19 16:54:57 +00:00
Brian Somers
385167a6b0 Accept MSCHAPv2 by default.
Enable and accept MPPE by default.
2000-11-19 16:53:50 +00:00
Brian Somers
80e2e6b62f Go back to populating data_len in struct ngpppoe_init_data. 2000-11-16 23:15:42 +00:00
Brian Somers
d9374c913e Be a bit more precise about what ``nat deny_incoming yes'' does. 2000-11-16 21:50:50 +00:00
Brian Somers
9100871e60 Increase M_MAXBUF so that it's greater than HDLCSIZE 2000-11-11 01:31:32 +00:00
Ruslan Ermilov
726b61ab5f Avoid use of direct troff requests in mdoc(7) manual pages. 2000-11-10 17:46:15 +00:00
Brian Somers
542962ddf9 Introduce another global (MPPE_IsServer) so that we initiate the
MPPE session keys correctly.

I'm a bit dubious about this code.  It seems that the session keys
are initialised differently based on whether you're the client or
the server.  One side is the server if it issues the first challenge,
but of course you can issue a challenge from both sides.... at the
same time.  Sounds like another wonderful M$ assumption...

Ppp can now talk to itself correctly using encryption.

Problem solved by:	Ustimenko Semen <semen@iclub.nsu.ru>
Hair torn out by:	me
2000-11-07 23:19:11 +00:00
Brian Somers
527a86a3ba Handle being given a connect()ed udp descriptor as stdin rather
than assuming it's unconnected.
2000-11-07 04:29:46 +00:00
Brian Somers
e1e8b15e7a Pass the correct output options to the ccp output initialisation
routine rather than passing it the first requested output option.

Ensure that options are freed correctly even if we don't reach
TLU.
2000-11-07 04:29:33 +00:00
Brian Somers
1c25c5e077 Merge some OpenBSD/NetBSD fixes to the recent MPPE/CHAP0x81 update. 2000-11-05 03:25:09 +00:00
Brian Somers
fca09861d8 Don't ignore the return from tcsetattr() - moan about it instead.
Suggested by: Andre Albsmeier <andre@akademie3000.de>
2000-10-31 23:27:35 +00:00
Tatsumi Hosokawa
85c2b43f35 Forgotten RELEASE_CRUNCH hack for mppe.c.
This fix is for "make release" and "make boot.flp".
2000-10-31 05:00:25 +00:00
Brian Somers
fbf0385368 Use the new-style ngpppoe_init_data structure.
Approved by: archie
2000-10-31 02:46:12 +00:00
Brian Somers
58b1e45d5d Mention that ``nat deny_incoming'' drops unrecognised IP packets.
Requested by: kris
2000-10-31 02:25:54 +00:00
Brian Somers
cf881f54ca Drop PKT_ALIAS_IGNORED packets if ``nat deny_incoming yes'' is in effect.
Approved by: rwatson, ru
2000-10-30 18:02:01 +00:00
Brian Somers
7f03ca53aa Add ``all'' logging.
Submitted by: eivind
2000-10-30 00:15:35 +00:00
Brian Somers
2388e045c4 Bump our version to reflect the recent MPPE additions (and ccp struct
size change).
2000-10-30 00:15:34 +00:00
Brian Somers
ba6fcad9cf Move the MPPE keysize display in ``show ccp''. 2000-10-30 00:15:33 +00:00
Brian Somers
9b9967924b Various whitespace changes.
Make some functions static.
2000-10-30 00:15:29 +00:00
Brian Somers
46c20a0ec0 staticise mbuftype() 2000-10-30 00:15:27 +00:00
Brian Somers
a8d604ab74 Add MPPE and MSChap v2 support (denied and disabled by default)
Submitted by: Ustimenko Semen <semen@iclub.nsu.ru>
2000-10-30 00:15:04 +00:00
Brian Somers
2661ef38a2 Ignore ``#'' properly when told to 2000-10-28 23:56:03 +00:00
Brian Somers
7c0833500d Report the type of mbuf that couldn't be allocated before
aborting ppp.
2000-10-27 05:34:40 +00:00
Brian Somers
ba093e813d Use rad_acct_open() instead of rad_auth_open().
Suggested by: Victor Ivanov <v0rbiz@icon.bg>
2000-10-15 01:05:57 +00:00
Brian Somers
2000bfb4cd Don't define NOATM now that /usr/include/netnatm/ is created properly. 2000-10-15 00:46:58 +00:00
Brian Somers
b2c374decb If write() gives -1/ENOBUFS, keep the packet and sleep for 1/10th
of a second before attempting to write it again (unless there's
something else to do instead).
2000-10-09 22:49:44 +00:00
Brian Somers
8a52f3ecfe Create fd_sets big enough to handle getdtablesize() descriptors. 2000-10-09 21:18:23 +00:00
Brian Somers
495d24ec4a Fix some style nits 2000-09-14 22:03:13 +00:00
Brian Somers
481a4f6155 Support PPPoATM, disabled for now as /usr/include/netnatm doesn't exist
Submitted by: Jakob Stoklund Olesen <stoklund@taxidriver.dk>
2000-09-14 22:02:54 +00:00
Brian Somers
2231246bb3 Understand IPPROTO_ESP and IPPROTO_AH packets
Submitted by: Angelos D. Keromytis <angelos@dsl.cis.upenn.edu>
2000-09-14 18:01:54 +00:00
Brian Somers
1a0f89e02b Spelling police
Submitted by:	des
2000-09-06 21:02:06 +00:00
Brian Somers
57c94dd3bc libutil.h is no longer required for setproctitle() 2000-09-02 02:16:51 +00:00
Ralf S. Engelschall
573365d5ad Fix resolv.conf line hint: "name-server" -> "nameserver" 2000-08-31 11:13:20 +00:00
Brian Somers
8507c35e67 Use arc4random() instead of random() 2000-08-31 00:45:24 +00:00
Brian Somers
4c066cf9f1 Don't treat two or more whitespace followed by a comment as
an empty argument

PR:	20937 (maybe)
PR:	20938
2000-08-30 20:51:13 +00:00
Brian Somers
106ae3d065 Complain about invalid arguments passed to ``set ifaddr'' 2000-08-30 20:49:50 +00:00
Brian Somers
43df7f1485 Correct LogMAX
Broken by:	me
Submitted by:	Mark Hannon <markhannon@one.net.au>
2000-08-29 17:00:52 +00:00
Brian Somers
75fbd185a0 Use srandom() under OpenBSD
Submitted by:	Matt Behrens <matt@megaweapon.zigg.com>
2000-08-29 16:47:45 +00:00
Brian Somers
06a43ce058 Add LogFILTER logging to log packets allowed by the dial filter and
dropped by any filter.

Submitted by: Mark Hannon <markhannon@one.net.au>

with some small tweaks by me.
2000-08-28 23:24:52 +00:00
Brian Somers
794c9bbc80 Support radius accounting, and add a packet count to throughput
statistics as a side effect.

Submitted by: Marcin Cieslak <saper@system.pl>

with some tweaks to RAD_ACCT_SESSION_ID and
RAD_ACCT_MULTI_SESSION_ID generation by me.
2000-08-28 22:44:54 +00:00
Brian Somers
68602c3ee0 Make -DNOSUID (or -DPPP_NOSUID) possible to build ppp without SUID
capabilities.
2000-08-18 00:01:44 +00:00
Brian Somers
c1a6c9e21c Warn that the ``alias'' command is depricated.
We still process it for now though.
2000-08-18 00:01:30 +00:00
Brian Somers
3fd1e17c02 If we're in MP mode with a single open link, MP link level compression
isn't open and the links MRU >= our MRRU, send outbound traffic as
PROTO_IP rather than PROTO_MP.  This shaves some bytes off the front
of each packet 'till the second link is brought up.

Idea obtained from: Cisco
2000-08-17 14:14:54 +00:00
Brian Somers
242373a7ee ISDN B channels have a bandwidth of 64000, not 65536
Pointed out by: Christian Weisgerber <naddy@mips.inka.de>
2000-08-16 13:54:04 +00:00
Brian Somers
ebe96675ee setproctitle() doesn't need to be called with root privs, so move
it from id.c into defs.c
2000-08-16 09:07:23 +00:00
Brian Somers
2ceee5e9a7 Default the bandwidth of an ISDN B channel to 65536bps 2000-08-16 09:06:59 +00:00
Brian Somers
91cbd2eec0 Maintain input and output throughput averages and choose the highest
of the two when calculating the MP throughput average for the ``set
autoload'' implementation.

This makes more sense as all links I know of are full-duplex.  This
also means that people may need to adjust their autoload settings
as 100% bandwidth is now the theoretical maximum rather than 200%
(but of course, halfing the current settings is probably not the
correct answer either!).

This involves a ppp version bump as we need to pass an extra
throughput array through the MP local domain socket.
2000-08-15 10:25:42 +00:00
Brian Somers
11572abf62 Calculate the average link throughput using a counter based on the
cumulative total of all active links rather than basing it on the
total of PROTO_MP traffic.

This fixes a problem whereby Cisco routers send PROTO_IP packets only
when there's only one link (hmm, what a good idea!).
2000-08-15 00:59:21 +00:00
Brian Somers
c837ca39c6 Don't delete sticky routes when unconfiguring the interface.
Deleting all routes that match the interface is sufficient.
2000-08-14 08:43:40 +00:00
Brian Somers
689f6effbb Index: ppp.8
===================================================================
RCS file: /home/ncvs/src/usr.sbin/ppp/ppp.8,v
retrieving revision 1.233
diff -u -r1.233 ppp.8
--- ppp.8	2000/08/10 13:26:01	1.233
+++ ppp.8	2000/08/12 19:50:41
@@ -1,8 +1,8 @@
 .\" $FreeBSD: src/usr.sbin/ppp/ppp.8,v 1.233 2000/08/10 13:26:01 brian Exp $
 .Dd 20 September 1995
 .nr XX \w'\fC00'
-.Os FreeBSD
 .Dt PPP 8
+.Os
 .Sh NAME
 .Nm ppp
 .Nd Point to Point Protocol (a.k.a. user-ppp)
2000-08-13 22:03:42 +00:00
Brian Somers
d0cd375a1d Mention that pppoe requires netgraph(4) and without it, an external
pppoe program must be used (such as pppoe(8) on OpenBSD).
2000-08-10 13:26:01 +00:00
Brian Somers
a2240f353a Allow leading ``!'' characters in authkeys and chat scripts to
be doubled up to mean a single literaly ``!''.
2000-08-09 19:29:50 +00:00
Brian Somers
4e9d6a7fc5 If the first character of the `set title'' argument is -',
put it into the format string, supporting ps's tweak to
setproctitle().
2000-08-09 10:22:48 +00:00
Brian Somers
759c81cbad Don't mis-interpret sockaddr_in6 structures as sockaddr_in structures
when purging routes.
2000-07-20 10:38:12 +00:00
Brian Somers
c8e376b582 Describe the new VERSION and COMPILATIONDATE macros and mention that the
``ident'' command will expand macros.
2000-07-19 10:14:00 +00:00
Brian Somers
1038894eb0 Support link identification from rfc1570
Two new commands are available; ``ident'' and ``sendident''.
2000-07-19 02:10:35 +00:00
Brian Somers
dd49e719c1 Permit multiple ``allow user'' lines in any given section
This avoids line length limits when large numbers of users are allowed
access to ppp.
2000-07-12 23:13:52 +00:00
Brian Somers
60498ea783 Correct ``set filter'' usage
Spotted by:	sheldonh
2000-07-12 16:31:47 +00:00
Brian Somers
cb8bd8dd72 Fix a rather nasty latency problem that occurs with single tcp sessions
thorough an MP setup with only a single link.
2000-07-12 15:08:03 +00:00
Brian Somers
0a4b6c5c5c Allow a ``timeout secs'' filter option to let specific packet types
effect the idle timer in different ways.

Submitted by: Stefan Esser <se@freebsd.org>

With adjustments by me to document the option in the man page and to
give the same semantics for outgoing traffic as incoming.

I made the style more consistent in ip.c - this should really have
been done as a separate commit.
2000-07-11 22:11:36 +00:00
Brian Somers
040cfe28d1 Fix -auto breakage introduced with the last commit. 2000-07-11 09:26:02 +00:00
Brian Somers
9825166754 o Log the (payload/size) of all packet types, not just TCP packets
o  If the new ``filter-decapsulation'' is enabled, delve into UDP packets
   that contain 0xff 0x03 as the first two bytes, and if we recognise it
   as PROTO_IP, decapsulate it for the purpose of filter checking.

   If we recognise it as PROTO_<anything else> mention this for logging
   purposes only.

This change is aimed at people running PPPoUDP where the UDP traffic is
being sent over another PPP link.  It's desireable to have the top level
link connected all the time, but to have the bottom level link capable
of decapsulating the traffic and comparing the payload against the filters,
thus allowing ``set filter dial ...'' to work in tunnelled environments.

The caveat here is that the top ppp cannot employ any compression layers
without making the data unreadable for the bottom ppp.  ``disable deflate
pred1 vj'' and ``deny deflate pred1 vj'' is suggested.
2000-07-07 14:22:08 +00:00
Brian Somers
a61800c2f3 kldload ng_ether if we need to. 2000-06-28 09:30:30 +00:00
Brian Somers
ec37734aeb Don't assign an MTU based on the peers first-link MRU in MP mode.
Use the peers MRRU as we're supposed to.
2000-06-24 23:37:14 +00:00
Brian Somers
77fc031d50 Fix a printf-style arg cast (again) 2000-06-23 09:48:26 +00:00
Brian Somers
b25838b462 e.g. -> e.g.,
Obtained from: OpenBSD
2000-06-23 09:48:02 +00:00
Brian Somers
a1bc3dccac Correct PPPoE in multi-link mode
Submitted by: jason@OpenBSD.org
2000-06-22 20:51:03 +00:00
Brian Somers
86c5e1ea4d Remove ``nat pptp'' as this is now done transparently by libalias. 2000-06-20 12:18:40 +00:00
Brian Somers
bee32c7928 Allow padding in LQR ECHO requests
Problem found by: Tomaz Borstnar <tomaz.borstnar@over.net>
2000-06-20 09:13:25 +00:00
Brian Somers
58a575135b Don't mis-match interface names in iface_Create()
Submitted by: Adrian Penisoara <ady@freebsd.ady.ro>
2000-06-19 21:43:48 +00:00
Brian Somers
669b99659d Fix a printf-style format error 2000-06-18 10:07:53 +00:00
Brian Somers
f3039b6800 A few more hard-sentence breaks. 2000-06-13 10:03:28 +00:00
Brian Somers
194750d657 Hard sentence breaks and trailing space tidy-ups
Obtained from: OpenBSD
2000-06-11 14:58:32 +00:00
Brian Somers
e97b220c8c Don't oan about padding characters 2000-06-11 12:22:06 +00:00
Brian Somers
6c1d673108 Add ``set ifqueue'' to control the size of the outgoing packet
queue.  Doing ``set ifqueue 0'' and ``set urgent none'' will allow
full use of luigi's WF2Q code.

Requested by: luigi
2000-06-11 02:30:51 +00:00
Brian Somers
4c24043766 Allow ``set urgent none'' to disable all urgent ports and IPTOS_LOWDELAY
prioritisation.

Requested by: luigi
2000-06-08 20:07:48 +00:00
Brian Somers
a339e6448b Use mp_CheckAutoloadTimer() rather than mp_StopAutoloadTimer()
when opening or closing an auto link due to the autoload
setting.

Spotted by: David Hedley <david@inty.co.uk>
2000-05-31 15:35:29 +00:00
Brian Somers
3356db52df Don't use the umask to chmod local domain server sockets, use
the mask
2000-05-31 09:06:52 +00:00
Brian Somers
962a3cbc83 If the fsm header reports a length greater than the packet size,
drop the packet rather than just whinging about it in the log.
If the fsm header has a smaller length, continue to whinge.
2000-05-26 21:11:55 +00:00
Brian Somers
07e4efad3d Remove an unused variable 2000-05-26 08:29:11 +00:00
Brian Somers
5e269efe6e When we do a `dial'' or `open'' from DATALINK_READY, go to
DATALINK_CARRIER and turn off scripting.

This should fix instances where ``term'' is used followed by ~.
and then ``dial''/``open'' (it currently just sits there looking
at you).

Reported by: Tim Vanderhoek <vanderh@ecf.utoronto.ca>
2000-05-26 08:26:56 +00:00
Brian Somers
682cb20f5d Fix a topy (if (expr); command;)
Submitted by:	Renaud Waldura <renaud@guppy.evolunet.com>
2000-05-25 16:12:55 +00:00
Brian Somers
d4c74446f7 The name /var/log/alias.log is *not* likely to change in the near
future...
2000-05-24 20:56:30 +00:00
Brian Somers
632cd66778 Mention what ``enable proxy'' actually does 2000-05-24 13:49:39 +00:00
Brian Somers
d9626e9459 Honour `set speed sync'' and `set device !program'' when
used together by creating a SOCK_DGRAM socketpair() between
the processes.

Be polite when closing !program links and send a HUP to the
process.  This makes ssh tunnels over unreliable media (such
as via httptunnel) reconnect properly.
2000-05-24 09:05:58 +00:00
Brian Somers
4518b0757f Mention it in the log file when we HUP a process that
controls a link.
2000-05-24 09:05:45 +00:00
Brian Somers
7fe0b59209 Don't attempt to fputs(NULL, fp) when ``enable dns'' is given and
there's no resolv.conf.
Use a umask of 022 when creating resolv.conf, not 0644 !
2000-05-24 01:00:24 +00:00
Brian Somers
eb598e08ff Always pass packets through libalias when NAT is enabled.
Submitted by: luoqi
Forgotten by: me
2000-05-23 14:55:08 +00:00
Brian Somers
bcff338667 Return -2 when tcp_OpenConnection() fails so that ppp doesn't
report that the device name is of an invalid format.
2000-05-22 08:23:35 +00:00
Brian Somers
7ebff0094c Be more verbose when a second link doesn't match the first because the
peer enddisc/authname is different.
2000-05-22 08:23:13 +00:00
Brian Somers
7d7b90c714 Fix a typo 2000-05-11 07:59:21 +00:00
Brian Somers
44d127bc34 Mention that the default is to let external traffic route to
the internal network when NAT is enabled.

Allow ``set target MYADDR'' to stop packets at the gateway.
2000-05-11 07:55:44 +00:00
Brian Somers
17e57a5fe3 Correct a bad bug in m_prepend()
Submitted by: luoqi
2000-05-07 10:08:24 +00:00
Brian Somers
328ecc101e Remove a rogue space 2000-04-13 00:00:46 +00:00
Brian Somers
9bf01bcb6c Add a missing ``break'' 2000-04-09 18:27:08 +00:00
Brian Somers
b42135dee3 When running ppp -background, show comfort messages showing
when we're redialing/reconnecting.

While we're here, log redial, reconnect and phone number
announcements to LogCHAT, and reduce some other logging to
LogDEBUG.
2000-04-07 23:46:14 +00:00
Brian Somers
c8f30703cd I didn't get this right the last time....
When an NCP reaches TLF, *ONLY* datalink_Close() links that are
in DATALINK_OPEN.

When the last link reaches TLD, DOWN all NCPs (as we used to in the
links TLF (which was the wrong place anyway)), as the NCPs aren't
now going to datalink_Close() us unexpectedly, we get to continue
doing what we were told to do in the first place.

The result:  When we lose a link, the IPCP layer goes down and
we actually call the stuff in ppp.linkdown !
2000-04-06 10:03:48 +00:00
Gary Jennejohn
27173c13e8 Pass me the pointy hat.
It was not a good idea to remove csu_header from struct cspace, it had
ramifications which I didn't notice.

Restore src/usr.sbin/ppp/slcompress.h to the way it was, since MAX_HDR
was already defined as 128 there and it's a user program anyway.

In sys/net/slcompress.h make MAX_HDR 128 intead of MLEN to avoid
bloat.

My apologies for any inconvenience.
2000-04-04 09:20:53 +00:00
Brian Somers
2a8e2fe669 Plug two file descriptor leaks 2000-04-03 19:56:49 +00:00
Gary Jennejohn
8810489433 Nuke csu_hdr from struct cspace. csu_hdr is not used anywhere in the
tree. This considerably reduces unnecessary bloat in struct slcompress.

I'm running with this change right now and have seen no negative
side-effects.

On my sytem this reduced kernel BSS by about 25KB.

Submitted by:	bde
Approved by:	brian for user-ppp
2000-04-03 19:54:33 +00:00
Brian Somers
e9d0dd0a1b Allow authname to be changed at any phase, just emit a warning
if it's not DEAD or ESTABLISH
2000-03-31 21:08:43 +00:00
Brian Somers
804e0a12f2 Use INADDR_NONE with PacketAliasSetTarget() if no args are given to
``nat target'', and suggest the use of ``nat target default'' as an
interesting possibility.
2000-03-31 20:42:24 +00:00
Brian Somers
4c2b812c39 Undo the damage done to this file in my last commit 2000-03-31 14:31:36 +00:00
Brian Somers
b7d8533c16 Add the ``nat target'' command. 2000-03-31 14:26:23 +00:00
Brian Somers
9962fa3956 Correct address parsing
Pointed out by: Maxim Sobolev <sobomax@altavista.net>
2000-03-30 10:46:20 +00:00
Brian Somers
b565321aa1 Log information about packets being dropped (probably due to
``nat deny_incoming yes'') by libalias.
2000-03-29 09:31:52 +00:00
Brian Somers
6578fcf3f3 Allow the use of hostnames instead of (and as well as) IP
numbers in all commands.
If people use hostnames and have dodgy resolvers or try to resolve
the hostname before the link is up, they get what they deserve....

Requested by: ru
2000-03-29 09:31:27 +00:00
Brian Somers
0e20b8777c Mention the value of the unexpected return code in nat_LayerPull() 2000-03-29 00:14:24 +00:00
Brian Somers
f3a0d054fe don't treat # specially if PARSE_NOHASH is passed 2000-03-28 15:14:15 +00:00
Brian Somers
effc341fe3 Don't treat # specially here 2000-03-28 15:11:38 +00:00
Brian Somers
5a83ad1eb1 Correct the parent notification diagnostic emitted from the child
process in -background mode (it should report failure if appropriate).
2000-03-22 03:02:01 +00:00
Brian Somers
5a8b6a98df If a links LCP FSM has reached TLF and it's the last link,
don't bother to re-initialise the NCPs.  Instead wait for
bundle_LinkClosed() to be called - IFF it actually is called.

By initialising the NCPs at this point, ppp was recursing
back into the fsm_Down() routing for the link, and losing
track of the reason that the link was being brought down.
The end result was that ``set reconnect'' would never do
anything.

Patiently pointed out by: ru
2000-03-22 03:02:00 +00:00
Brian Somers
4b567bf209 Don't bother setting the dial timer if we've closed a
background/foreground/direct and zero'd the redial/reconnect
counts.
2000-03-22 03:01:56 +00:00
Brian Somers
3ce91245fc Do some vfork() trickery so that the parent can determine
if the childs exec() has succeeded or failed by taking advantage
of the fact that both processes share the same memory.

FWIW:
  I tried to implement this by doing a pipe(), setting the
  write desciptors close-on-exec flag in the child and writing
  errno to the descriptor if the exec() fails.  The parent can
  then ``if (read()) got errno else exec worked''.

  This didn't work though - the child could write() to fd[1] on
  exec failure, but the parent got 0 trying to read() from fd[0] !
  Is this a bug in execve() ?
2000-03-22 03:01:53 +00:00
Brian Somers
0cd8e9020a Call bundle_CleanDatalinks() after UpdateSet() in case we're
dropping out of background/foreground/direct mode.

This avoids either having to wait for the redial timer before
exiting or jaming up in select() waiting for something that'll
never happen.
2000-03-22 03:01:48 +00:00
Brian Somers
a1f961d3a3 Add some diagnostics to prove that incoming IP fragments are
being dealt with correctly.
2000-03-19 12:37:27 +00:00
Brian Somers
311a9da249 Move a comment to make things a bit more readable.
Suggested by: sheldonh
Forgotten by: me
2000-03-16 16:28:27 +00:00
Brian Somers
2793563fc4 Increase bit fields to allow for new values 2000-03-14 20:11:45 +00:00
Brian Somers
959d90ef1d ppps -> ppp's; suggested by sheldonh
.Nm ppp -> .Nm; overlooked by me
Microsofts -> Microsoft's; OpenBSD
2000-03-14 20:04:32 +00:00
Brian Somers
a60f44db18 Understand -DNOINET6 2000-03-14 19:33:13 +00:00
Brian Somers
2a30e2ac0b Understand environment variables in commands
Submitted by: Mark Knight <markk@knigma.org>
2000-03-14 01:47:31 +00:00
Brian Somers
d568d6c405 Add the ``resolv'' command for telling ppp how to deal with resolv.conf.
You can now ``resolv restore'' in ppp.linkdown !
Add DNS0 and DNS1 macros.
2000-03-14 01:47:27 +00:00
Brian Somers
574a3ffd78 Refresh the NAT IP pointer after a potential mbuf reallocation. This
caused frequent lock-ups for individual sessions over a NAT'd ppp link
when MTU sizes ended up more or less exactly wrong.
2000-03-14 01:47:21 +00:00
Brian Somers
209dc10239 Fix some printf-style argument bugs 2000-03-14 01:47:19 +00:00
Brian Somers
ceecaea3de Fix some typos
Obtained from: OpenBSD
2000-03-14 01:47:13 +00:00
Brian Somers
499640f195 Adjust whitespace 2000-03-14 01:47:11 +00:00
Brian Somers
b9fa960d93 Don't include netinet6/in6.h directly. 2000-03-14 01:47:09 +00:00
Brian Somers
8e7bd08ea4 Correct some typos introduced in the descriptor -> fdescriptor change. 2000-03-14 01:47:07 +00:00
Brian Somers
10e629b937 Introduce LOCALNAT and LOCALRAD defines so that the sources can stay
exactly the same in FreeBSD & OpenBSD despite libalias and libradius
being local to the ppp sources under OpenBSD.
2000-03-14 01:47:02 +00:00
Brian Somers
f84f2c0057 Correct UN_SIZE definition
Submitted by: Ben Smithurst <ben@scientia.demon.co.uk>
2000-03-14 01:46:58 +00:00
Brian Somers
24731321e6 Don't ``break'' when we come accross a non-RTM_IFINFO type
entry in the block returned by the NET_RT_IFLIST mib,
``continue''

Broken a few minutes ago by: me
2000-03-14 01:46:56 +00:00
Brian Somers
d6d3eeab46 When ppp can't identify the relevant name, don't use "???", use
<nnn> or <0xxxx> instead.
2000-03-14 01:46:54 +00:00
Brian Somers
52c9ca1968 Add ``set log dns'' to log DNS QUERY packets.
This is invaluable for dial-on-demand connections...
In ppp.linkup:

  set log -dns -tcp/ip

and in ppp.linkdown

  set log +dns +tcp/ip

giving a much better account of why the link came up.
2000-03-14 01:46:49 +00:00
Brian Somers
6b4579784c The interface list that comes back from the PF_ROUTE/NET_RT_IFLIST mib
is aligned.  Teach this to ``show route''.

Clean up some of the sockaddr parsing routines.
2000-03-14 01:46:44 +00:00
Brian Somers
6b38466448 Support IP6 addresses in ``show route''
Also, don't try to output routing entries if either the
RTA_DST or RTA_GATEWAY sockaddrs aren't present.
2000-03-14 01:46:38 +00:00
Brian Somers
76ce2d4bcb When adjusting timer::rest, round to the closest TICKUNIT usecs
value.

This has minimal impact here, but if ppp ever needs to frequently
remove timers before they've timed out, it can badly skew the next
item in the timer list without this change.

The correct fix would be to store usecs in `rest' rather than
TICKUNITs, but the math is easier if we just round...
2000-03-14 01:46:34 +00:00
Brian Somers
e722aa17f8 When we stop a timer that's the first in the timer list, ensure
that we adjust that timers `rest' value (with the current getitimer()
values) before using that to adjust the next items `rest' value.
After adjusting that value, restart the timer service so that we've
now got the correct setitimer() values.
2000-03-14 01:46:31 +00:00
Brian Somers
f013f33ee2 To avoid namespace polution in NetBSD:
``struct descriptor'' -> ``struct fdescriptor''
2000-03-14 01:46:09 +00:00
Kris Kennaway
38e1809ae3 Remove the last vestiges of libRSAglue now that it's an empty stub.
This should fix the buildworld problems some people were seeing.

Approved by:	jkh
2000-03-11 22:34:10 +00:00
Kris Kennaway
bb49f794f5 Buildworld fixes for NO_OPENSSH and NO_OPENSSL
Approved by:	jkh
2000-03-09 06:29:05 +00:00
Sheldon Hearn
4e86fcacf6 Remove more single-space hard sentence breaks. 2000-03-02 14:54:02 +00:00
Mark Murray
ec81a4cee3 Update DISTRIBUTION for new crypto world order 2000-02-29 11:44:18 +00:00
Mark Murray
512182f3ff Use libcrypto instead of libdes. 2000-02-24 21:10:28 +00:00
Ruslan Ermilov
dfd9528b30 Unbroke the reference to libalias(3). 2000-02-05 15:25:15 +00:00
Brian Somers
cda4644c28 Remove MAINTAINER=
I don't claim to own the code and certainly don't want to discourage
people from fixing or updating it.

[I know it's the 29th, but the FREEZE hasn't yet been posted to committers]
2000-01-29 11:08:00 +00:00
Brian Somers
225e259db9 If we're in callback mode, don't forget this fact when we
get into datalink_Down().

Submitted by: David Hedley <david@inty.co.uk>
2000-01-27 00:40:25 +00:00
Brian Somers
d81cf7d011 Actually ignore comments at the end of lines - broken with the commit
that made ppp *not* treat #s in quoted arguments as comments.
2000-01-27 00:40:10 +00:00
Brian Somers
3a7b6d76a7 Handle the availability of TUNSIFHEAD. If it's there, use it.
For the moment this is just overhead, but it'll be used for INET6
support later.
2000-01-23 01:48:19 +00:00
Brian Somers
06b47306d1 Use TUNSIFPID when we change our PID (if it exists). 2000-01-21 00:33:27 +00:00
Brian Somers
82de8666e1 Use AUTHLEN for the length of authname 2000-01-17 12:27:29 +00:00
Brian Somers
278657c32d Don't set ifaddr::in_addrs to 1 after an ``iface clear'' on an interface
with no addresses.
2000-01-07 03:47:12 +00:00
Brian Somers
35099b5d17 include stdlib.h (setproctitle() is prototyped there in OpenBSD) 2000-01-07 03:23:38 +00:00
Brian Somers
ff36f30c56 Call serial devices `cuaXX'' instead of `cuaaX'' (in line
with OpenBSD conventions).
2000-01-07 03:11:56 +00:00
Brian Somers
bb8ec81ec9 .Bl -tag requires -width too
Obtained from: OpenBSD
2000-01-07 03:11:42 +00:00
Brian Somers
57f0cd1068 Remove an unused #define 2000-01-07 03:11:31 +00:00
Brian Somers
323b15a1c0 Ensure that there's a bit of extra space in our buffer when it's
passed to libalias.  If there's not enough space, things like ftp
PORT commands start failing....

Reported by: Gianmarco Giovannelli <gmarco@giovannelli.it>
2000-01-03 20:09:23 +00:00
Brian Somers
a40fdd98b0 Increase M_MAXLEN from 2048 - sizeof struct mbuf to
4096 - sizeof struct mbuf, and set MAX_MRU and MAX_MTU
back to 2048.

2048 is big enough as an MTU/MRU, but we need to be able
to allocate larger mbufs after reassembling IP fragments.
1999-12-30 13:27:15 +00:00
Brian Somers
e7d008b4bd Add a few missing #includes 1999-12-30 03:40:29 +00:00
Brian Somers
a19a5c023d Correct usages of getuid() and geteuid()
Pointed out by: billf
1999-12-30 03:36:11 +00:00
Brian Somers
bb7d10c9c5 Mention that it's only necessary to escape the '-' in chat scripts
twice (once for the arg parsing and once to make it a normal character).
Make the man page example consistent.

Reminded by: Bryan Liesner <bleez@netaxs.com>
1999-12-29 22:31:10 +00:00
Brian Somers
182c898a22 Add a bunch of `const's and fix a typo.
Submitted by: Rich Neswold <rneswold@MCS.Net>
1999-12-27 11:54:57 +00:00
Brian Somers
5b78bdf8aa Don't allowt '#' as a comment when it's embedded in quotes:
set something "xxx yyy # zzz" aaa

shouldn't be interpreted as

  set something "xxx yyy" aaa
1999-12-27 11:43:31 +00:00
Brian Somers
e62ce959d0 Don't bother fork()ing after closing a ctty if ppp is about to
terminate anyway.
1999-12-23 21:43:25 +00:00
Brian Somers
1bbd8362c7 Understand double-quotes anywhere on a command line in the same
way that a shell does.  The previous way ppp did it just didn't
make any sense.
1999-12-23 21:43:12 +00:00
Brian Somers
90e7fb01df Correct warning about unindented commands when the unindented command
is actually a new label with a comment at the end of the line.
1999-12-23 21:43:00 +00:00
Brian Somers
abab7303b5 Don't munge ``set dial|login|logout|hangup'' arguments before
ExpandString() has a chance to do its own substitutions.
1999-12-22 21:48:12 +00:00
Brian Somers
1b365e7039 Fix my '#'-at-end-of-lines change, spammed by a subsequent commit. 1999-12-20 20:47:58 +00:00
Brian Somers
687d9f5709 Use getpwuid()->pw_dir instead of $HOME when expanding ``~''. 1999-12-20 20:30:47 +00:00
Brian Somers
8b50b30fa7 Use getpwuid() instead of getlogin() in ``allow users''. 1999-12-20 20:30:40 +00:00
Brian Somers
ef0a48491b Add missing linefeed. 1999-12-20 20:30:35 +00:00
Brian Somers
dbde41c0b7 Cosmetic: clean up some parenthesis confusion 1999-12-20 20:30:30 +00:00
Brian Somers
9409953d84 Handle comments at the end of lines. 1999-12-20 20:30:25 +00:00
Brian Somers
c39aa54ec8 Notice and warn about unterminated quoted strings in commands.
The entire command is ignored if the syntax is invalid...
1999-12-20 20:30:02 +00:00
Brian Somers
dae8dd31bf Implement mbuf allocation internally by maintaining 8 buckets of
different sized mbufs, and mallocing them in chunks of 20 mbufs
at a time.

This improves back-to-back throughput by between 7 and 8%
1999-12-20 20:29:51 +00:00
Brian Somers
26af0ae966 Cosmetic: Make struct mbuf more like kernel mbufs. 1999-12-20 20:29:47 +00:00
Brian Somers
aa4e734249 Learn to do pointer arithmatic (doh!) 1999-12-18 02:31:36 +00:00
Brian Somers
9acc846078 Handle PPPoPTY correctly. 1999-12-13 18:45:21 +00:00
Brian Somers
ffcfaec721 Be careful not to re-initialise `struct stat' while it still has
a running timer.  This fixes a problem where a dial is manually
aborted, the hangup script kicks in and the chat timer ends up
on the timer queue twice (tick tick tick tick *boom*)
1999-12-03 06:33:10 +00:00
Brian Somers
cbee975442 Change the way we transfer links (again). The previous
method avoided all race conditions, but suffered from
sometimes running out of buffer space if enough clients
were piled up at the same time.

Now, the client pushes the link descriptor, one end of a
socketpair() and the ppp version via sendmsg() at the
server.  The server replies with a pid.  The client then
transfers any link lock with uu_lock_txfr() and writev()s
the actual link contents.  The socketpair is now the only
place we need to have large socket buffers and the bind()ed
socket can keep the default 4k buffer while still handling
around 90 racing clients.
1999-11-30 23:52:37 +00:00
Brian Somers
886530ab78 depricated -> deprecated + mention the -alias flag status in README.changes 1999-11-29 18:53:43 +00:00
Brian Somers
97536b3bb8 Don't try to do a DIALOUT in -direct mode or if there's no phone
numbers set.
1999-11-28 15:50:23 +00:00
Brian Somers
f6a4e748a9 Make -foreground a proper option (allowing ``allow mode foreground'',
``set mode foreground'' etc.
1999-11-28 15:50:08 +00:00
Brian Somers
b5c3c9aeda Allow extended pap success messages by believing in the PAP headers
length field rather than the one byte message length field embedded
in the packet.  This steps slightly outside of the protocol boundaries,
but should not cause any problems.

Limitation noted by: Simon Winwood <simon@winwood.org>
1999-11-26 22:44:45 +00:00
Brian Somers
fdc29d54a4 Change ``set cd'' so that its default value is device specific. The
default is still 1 second for ttys, but is now 6 seconds for i4b (ISDN)
devices and 5 seconds for ethernet (PPPoE) devices.
1999-11-26 22:44:33 +00:00
Brian Somers
2cb305af77 Rewrite the link descriptor transfer code in MP mode.
Previously, ppp attempted to bind() to a local domain tcp socket
based on the peer authname & enddisc.  If it succeeded, it listen()ed
and became MP server.  If it failed, it connect()ed and became MP
client.  The server then select()ed on the descriptor, accept()ed
it and wrote its pid to it then read the link data & link file descriptor,
and finally sent an ack (``!'').  The client would read() the server
pid, transfer the link lock to that pid, send the link data & descriptor
and read the ack.  It would then close the descriptor and clean up.

There was a race between the bind() and listen() where someone could
attempt to connect() and fail.

This change removes the race.  Now ppp makes the RCVBUF big enough on a
socket descriptor and attempts to bind() to a local domain *udp* socket
(same name as before).  If it succeeds, it becomes MP server.  If it
fails, it sets the SNDBUF and connect()s, becoming MP client.  The server
select()s on the descriptor and recvmsg()s the message, insisting on at
least two descriptors (plus the link data).  It uses the second descriptor
to write() its pid then read()s an ack (``!'').  The client creates a
socketpair() and sendmsg()s the link data, link descriptor and one of
the socketpair descriptors.  It then read()s the server pid from the
other socketpair descriptor, transfers any locks and write()s an ack.

Now, there can be no race, and a connect() failure indicates a stale
socket file.

This also fixes MP ppp over ethernet, where the struct msghdr was being
misconstructed when transferring the control socket descriptor.

Also, if we fail to send the link, don't hang around in a ``session
owner'' state, just do the setsid() and fork() if it's required to
disown a tty.

UDP idea suggested by: Chris Bennet from Mindspring at FreeBSDCon
1999-11-25 02:47:04 +00:00
Brian Somers
be8bbe8809 Don't setuid() 'till we've called ID0setproctitle() 1999-11-23 00:14:50 +00:00
Brian Somers
31dd45c4e0 Call MkSockNode() as uid 0
Forgotten by: julian
1999-11-21 23:27:23 +00:00
Brian Somers
dc4511d5eb Don't compile NETGRAPH out of ppp for the release crunch 1999-11-20 10:55:27 +00:00
Brian Somers
83569b351c Update the time delta of the first item in TimerList before
inserting a new item.  Without this, it's possible to
mis-insert quite badly... but only by as much as the load of
the first item, which is almost always 1 second.

Initialise the timerservice with `restart' set if we're inserting
at the start of the list.
1999-11-19 23:21:13 +00:00
Brian Somers
cf0a39401d Fix ``set proctitle'' by using setproctitle(). 1999-11-17 21:12:35 +00:00
Brian Somers
02cfb3ba65 Remove some extraneous ifdefs, and don't try to put the socket in
O_NONBLOCK.  The select() is the best best as I don't want to muck
about with the send/receive thresholds.
1999-11-16 21:57:48 +00:00
Brian Somers
fdb4bb1b89 Use modfind() to check if a kld is already loaded.
Submitted mostly by: green
1999-11-16 21:57:34 +00:00
Brian Somers
e6ee5b3933 Don't insist on 4 digit umasks in ``set server''.
Pointed out by: joerg
1999-11-13 16:18:40 +00:00
Brian Somers
9b1b0fc0e0 Make the meaning of the provider part of the PPPoE device spec clearer. 1999-11-13 16:18:27 +00:00
Brian Somers
0c38fb0340 Oops, netgraph.o -> ether.o for the RELEASE build. 1999-11-11 02:25:17 +00:00
Brian Somers
772d2e0939 If dev->connected is already set to CARRIER_OK in ether_AwaitCarrier,
don't go and set it to CARRIER_LOST !
1999-11-09 23:30:59 +00:00
Brian Somers
da8b70349b Don't recurse into datalink_UpdateSet() after
doing a HangupDone().  The HangupDone() may fuel
bundle_CleanDatalinks(), and if so, the bogus
UpdateSet() ends up select()ing on a closed
descriptor.....

Change the main `do/while' loop to a `for' loop so
that any `continue's do the bundle_CleanDatalinks()
& bundle_IsDead() bit.
1999-11-09 23:21:47 +00:00
Brian Somers
9d06928d0e Correct the ``-unix X'' parsing (last time I only corrected
``-unitX''.

Pointed out twice by: Gert-Jan Vons <gert-jan@bigfoot.com>
1999-11-09 21:59:09 +00:00
Brian Somers
4012527343 Be a bit smarter when identifying a netgraph node
(don't dereference NULL).
1999-11-09 19:05:48 +00:00
Brian Somers
0d3751e7bd Don't treat -unit as a mode flag when counting mode flags.
Submitted by: Gert-Jan Vons <gert-jan@bigfoot.com>
1999-11-09 00:32:21 +00:00
Brian Somers
0f9c420717 Add an empty netgraph.o when building a release to keep the
crunch stuff happy.

Breakage spotted by: phk
1999-11-09 00:16:30 +00:00
Brian Somers
6b8b6bef1a Don't zero-pad netgraph node ids
Recommended by: julian
1999-11-07 09:03:45 +00:00
Brian Somers
87c3786e7f Support PPPoE
Help (lots) from: julian, archie
Facilities from: ahebert@pubnix.net
1999-11-06 22:50:59 +00:00
Brian Somers
c116e0c0aa Introduce ``set logout''; another chat script. This is in preparation
for the abstraction of ``set dial'' and ``set hangup''.
1999-10-25 13:49:44 +00:00
Brian Somers
bacfb041e0 Don't (unnecessarily) parse wtmp, force ID0logout() to DTRT instead. 1999-10-25 13:31:42 +00:00
Brian Somers
1a80353cd8 Manually create a correct(*) entry in wtmp when logging out a PPPoTCP or
PPPoUDP connection.

(*) This is as correct as ftp and uucp wtmp entries are - that is,
multiple concurrent connections will not record enough information
in wtmp to tell last(1) who was logged in for how long.
1999-10-21 21:55:22 +00:00
Brian Somers
f1b965c94b If we're running ppp -direct over a tcp or udp connection,
record the IP number in the `from' slot and not the tty slot.
We put ``ppp'' in the tty slot - in line with what ftp (and
probably others) does.
1999-10-21 01:19:23 +00:00
Brian Somers
1b02dfb47c Don't go from PHASE_NETWORK to PHASE_ESTABLISH when we want to
re-open a device.  The fact that we're in NETWORK phase indicates
that there are other links in DATALINK_OPEN and that we don't want
to stop using them.
1999-10-21 00:19:33 +00:00
Brian Somers
c0593e34b7 Add the -unit command line switch for specifying the tun device.
Warn about -alias being depricated (but still allow it).
Don't moan twice about failing to open any tun device.
Fix a diagnostic and add the -quiet switch to the usage message.
1999-10-19 15:21:09 +00:00
Brian Somers
53dc037c22 Correct a few diagnostics 1999-10-16 13:28:04 +00:00
Brian Somers
7ca1ffb46f Don't ntohl() the signature before printing it... it's already
been done.

Spotted by: Gert-Jan Vons <gert-jan@bigfoot.com>
1999-10-16 09:18:15 +00:00
Brian Somers
c2e1f0e3d7 When more than one timer is expired at once, allow for the possibility
that the first timer ends up doing a timer_Stop() on the second.

When this happens, remove the timer from the pending list so that
we still call any subsequent timers.

This bug has been here for several years, but has only been tickled
recently with my device layering changes.

With enormous thanks for the perseverance of: Ruslan Ermilov <ru@ucb.crimea.ua>
1999-10-15 20:44:34 +00:00
Brian Somers
d4d5d2f881 When we get the last NCP TLD, close all datalinks with CLOSE_STAYDOWN
rather than CLOSE_NORMAL.
1999-10-15 20:36:04 +00:00
Brian Somers
1d3a2f02e5 Redefine CRTS_IFLOW and CCTS_OFLOW on the mac.
Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp>
1999-10-15 20:30:44 +00:00
Brian Somers
71981dcfc1 When uncompressing VJ-compressed frames, fix the ip_sum directly
in struct cstate rather than copying the stored header slot into a
potentially mis-aligned buffer then trying to update the ip_sum
without causing an exception on non-i386 hardware.

I've never been able to reproduce this problem, but it has been
reported by many people... besides, the code is now a bit cleaner.

Testing & patience by: Anthony Solovjoff <asolovjoff@hotmail.com>
1999-10-13 07:49:13 +00:00
Brian Somers
d81ecf9abf Revert the 1.44 -> 1.45 change. It doesn't work as expected. 1999-10-08 16:09:15 +00:00
Brian Somers
14e34a55c3 Don't go from datalink state opening directly to lcp, go via
carrier instead so that we can set up our carrier detect
timer and eventually notice when we lose carrier.

Honour the script.run value when coming out of carrier state.

PR:	14145
1999-10-07 07:32:12 +00:00
Brian Somers
990a543f49 Mention the received/expected magic for dodgy ECHO LQRs. 1999-10-06 23:22:54 +00:00
Brian Somers
d2f5232de3 Bring links down gently when their throughput isn't enough for
the ``set autoload'' value.  Don't just ``down'' the link.
Don't get stuck in ``ready'' the first time we ``close'' a link.
1999-10-05 05:01:44 +00:00
Brian Somers
28149effa7 Support GRE packets
Submitted by: Harry Starr <starr@gccs.com.au>
1999-09-30 07:23:13 +00:00
Brian Somers
ccd587f00f Support ``set cd off'' to tell ppp not to even look for carrier on the
device.
1999-09-26 23:02:18 +00:00
Brian Somers
3c9497b9e0 Typo
Submitted by:	Alex Nash <nash@mcs.net>
1999-09-24 23:57:22 +00:00
Brian Somers
735ce767c7 Allow ``make -DNOKLDLOAD'' 1999-09-22 00:44:45 +00:00
Brian Somers
fc3034ca7d Do a kldload() if we get ENXIO trying to open /dev/tun0
Originally submitted by: green
1999-09-22 00:40:47 +00:00
Brian Somers
b9391689ee Back out the bogus #ifdef __NetBSD__ #include <signal.h> lines.
The original report was due to a mis-installation of the NetBS
header files :-/

Submitted by:	 Kazuyoshi Kato <kazk@yyy.or.jp>
1999-09-21 19:37:00 +00:00
Brian Somers
3927c47b04 Fix the `lt'' comparison in `set filter''
PR:		13819
Submitted by:	Dean M. Phillips <dphill@inav.net>
1999-09-21 01:02:05 +00:00
Alexey Zelkin
c6d6e7726f Correct spelling : ascii -> ASCII
PR:		docs/13702
Submitted by:	Stephen J. Roznowski <sjr@home.com>
Reviewed by:	mpp
1999-09-20 09:15:23 +00:00
Brian Somers
7e795ebe38 NetBSD has moved ``extern int errno;'' to signal.h :-/
Submitted by:	Kazuyoshi Kato <kazk@yyy.or.jp>
1999-09-20 07:36:46 +00:00
Brian Somers
a77cab77c5 NetBSD requires net/if.h for the IFF_* defines (as well as OpenBSD) ! 1999-09-20 07:18:50 +00:00
Brian Somers
4d9d17fe7d Correct the return from FilterCheck for fragments
PR:		13771
Submitted by:	Dean M. Phillips <dphill@inav.net>
1999-09-16 18:47:59 +00:00
Brian Somers
f02c2029cf Cosmetic:
alias_cmd -> nat_cmd after a repo-copy
1999-09-08 07:34:52 +00:00
Brian Somers
55b9d469e8 We don't need a queue for *CP data - these are IP-only queues. 1999-09-07 14:34:55 +00:00
Brian Somers
da47788649 Introduce a forth IP packet queue. Urgent packets with
ip_tos == IPTOS_LOWDELAY now get precidence over urgent
packets with ip_tos != IPTOS_LOWDELAY and non-urgent packets
with ip_tos == IPTOS_LOWDELAY.

Enhance the ``set urgent'' syntax to allow for urgent UDP
packets as well as urgent TCP packets.
1999-09-07 07:51:11 +00:00
Brian Somers
19c566804c Make the ``Problem with IP header length'' error a bit more verbose 1999-09-06 18:20:26 +00:00
Brian Somers
f914f3c09c $FreeBSD$ -> __DATE__
This is probably more appropriate that $Date$ anyway
1999-09-06 18:11:50 +00:00
Brian Somers
b4f63b0b8b When logging warning messages, there are now three scenarios:
o If a prompt is executing the command, only display the warning to
  that prompt
o If a prompt is executing a ``load'' command, display the warning
  to all prompts *and* syslog
o Otherwise, display the warning to all prompts *and* syslog.
1999-09-06 08:16:33 +00:00
Peter Wemm
2735dafdfc $Date$ -> $FreeBSD$ 1999-09-06 07:36:44 +00:00
Brian Somers
442f849547 o Split the two IPCP queues into three - one for FSM data
(LCP/CCP/IPCP), one for urgent IP traffic and one for
  everything else.
o Add the ``set urgent'' command for adjusting the list of
  urgent port numbers.  The default urgent ports are 21, 22,
  23, 513, 514, 543 and 544 (Ports 80 and 81 have been
  removed from the default priority list).
o Increase the buffered packet threshold from 20 to 30.
o Report the number of packets in the IP output queue and the
  list of urgent ports under ``show ipcp''.
1999-09-04 00:00:21 +00:00
Brian Somers
f10f520361 When sending radius authentication requests:
Supply RAD_NAS_IDENTIFIER if we have a `hostname` and
  RAD_IP_ADDRESS if that hostname resolves.

  Supply RAD_NAS_PORT using the ttyslot() of the tty that
  we're authenticating on if it's a tty device.

Partially submitted by: Andriy I Pilipenko <bamby@marka.net.ua>
PR:			12225
1999-09-03 10:31:34 +00:00
Peter Wemm
97d92980a9 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Jordan K. Hubbard
3b3533f56d I misunderstood the failure mode - revert BINMODE to 4554. I'm still
going to remove ppp from the installation options in 5 days if ppp is
still broken, however, as it hasn't worked at installation time
for several weeks now and it's only causing people to fill my mailbox
with questions.
1999-08-27 07:47:17 +00:00
Jordan K. Hubbard
4d391b8dd9 I don't know who decided that an install mode of 4544 was correct, but
for a binary it's far from it.  This is why sysinstall is unable to run
ppp at startup time and causing weirdies in -current.
1999-08-27 06:01:27 +00:00
Brian Somers
8473f372df Rebuild the list of interface numbers to names if we're trying
to evaluate an interface number that didn't previously exist.
1999-08-26 20:01:20 +00:00
Brian Somers
6fd578c435 Aligh mbufs to sizeof(long), not 4 1999-08-26 06:37:53 +00:00
Brian Somers
28f6cd8d9d Fix some mdoc(7) style inconsistences
Submitted by: Alexey M. Zelkin" <phantom@cris.net>
1999-08-25 21:39:40 +00:00
Brian Somers
4c960c5274 Cosmetic: bring closer to RELENG_3 1999-08-23 23:13:59 +00:00
Brian Somers
a3d4bca7a0 NOALIAS -> NONAT
Reminded by: jkh
1999-08-22 23:17:57 +00:00
Brian Somers
d40a462ae2 Allow authkey to be changed independently of the current phase. 1999-08-22 01:29:53 +00:00
Brian Somers
67b072f732 o Add the -foreground switch. This switch behaves like -background except
that ppp stays in the foreground.
o Add the -quiet switch to quieten ppps startup
o Add the -nat flag and discourage the use of the -alias flag.  Both do
  the same thing.
o Correct some nat usage strings.
o Change the internal ``alias'' command to ``nat''.
1999-08-19 18:15:52 +00:00
Brian Somers
62d50f2278 Mention `alias enable no'', not `alias enable off''. 1999-08-18 15:35:54 +00:00
Brian Somers
dade2407e6 Implement a minimum idle time value as an optional second argument
to ``set timeout''.
This is useful for situations where your minimum call charge is (say)
5 minutes (like mine is)
1999-08-17 17:22:46 +00:00
Brian Somers
44e73c1254 Set the close-on-exec flag for all unused descriptors when
exec()ing other programs.
1999-08-17 14:59:05 +00:00
Brian Somers
8a59beb7de If we receive an IPCP protocol reject, bring it down. 1999-08-10 08:42:20 +00:00
Brian Somers
cde8638bc5 Back out the last patch. I'm too tired to apply patches. 1999-08-09 23:49:59 +00:00
Brian Somers
02b485a4b8 Remove CLOCAL when we're not in -dedicated mode.
PR:		13046
Submitted by:	Vsevolod Lobko <seva@alex-ua.com>
1999-08-09 23:38:56 +00:00
Brian Somers
e531f89a62 Change printf formats %q[du] -> %ll[du] 1999-08-09 22:56:18 +00:00
Brian Somers
1080ea25e8 Insist that ppp.conf and it's parent directories aren't `other'
writable rather than not being writable at all.

PR:			13009
Kind-of submitted by:	Anthony Kimball <alk@pobox.com>
1999-08-09 22:54:51 +00:00
Brian Somers
b18a6818a6 Silence a warning about uninitialized variables. 1999-08-08 17:36:10 +00:00
Brian Somers
7ad4503cb4 Don't includei 4b support on the alpha 1999-08-08 17:35:35 +00:00
Brian Somers
9cf01ccf8c Don't log_Printf(..., buf) in case buf contains %s
Info provided by: Ollivier Robert <roberto@keltia.freenix.fr>
1999-08-08 15:19:00 +00:00
Brian Somers
eb6e5e05f9 Add ISDN support via isdnd & i4b. This requires version
0.81.1 of the i4b code - namely support of the I4B_VR_REQ
ioctl via the i4brbchX device.

Ppp controls the phone number, but idle timers and
SYNC/RAW decisions are still made by isdnd (in isdnd.rc).

This involves a new datalink state machine phase.  The
``wait for carrier'' phase happens after dialing but
before logging in.  The whole dial state should really
be abstracted so that each device type can deal with it
in its own way (thinking about PPPoE) - but that'll have
to wait.

The ``set cd'' symantics remain the same for tty devices,
but we now delay until we either get CD or timeout waiting
(at which time we drop the link if we require CD).

For i4b devices we always insist on carrier.

Thanks to hm@ for his help, and especially for pointing out
that I *don't* need to re-implement isdnd (that was a huge
waste of time !) :-]
1999-08-06 20:04:08 +00:00
Brian Somers
dbb69e525e If the clock is put back, ensure that we don't end up dividing by
zero when calculating our throughput
1999-08-06 01:34:03 +00:00
Brian Somers
ab2de065b2 o Obsolete the undocumented ``set weight'' command.
o If we're using RADIUS and the RADIUS mtu is less than our
  peers mru/mrru, reduce our mtu to this value for NetBSD too.
o Make struct throughput's sample period dynamic and tweak the ppp
  version number to reflect the extra stuff being passed through
  the local domain socket as a result (MP mode).
o Measure the current throughput based on the number of samples actually
  taken rather than on the full sample period.
o Keep the throughput statisics persistent while being passed to
  another ppp invocation through the local domain socket.
o When showing throughput statistics after the timer has stopped, use
  the stopped time for overall calculations, not the current time.
  Also show the stopped time and how long the current throughput has
  been sampled for.
o Use time() consistently in throughput.c
o Tighten up the ``show bundle'' output.
o Introduce the ``set bandwidth'' command.
o Rewrite the ``set autoload'' command.  It now takes three arguments
  and works based on a rolling bundle throughput average compared against
  the theoretical bundle bandwidth over a given period (read: it's now
  functional).
1999-08-05 10:32:16 +00:00
Brian Somers
93a25fb90a Reorganise ppp's usage to avoid some mandoc limitations.
Suggested by: wollman
1999-08-03 16:14:38 +00:00
Brian Somers
badaf18d92 Mention that ospf is a possible filter protocol. 1999-08-02 21:45:36 +00:00
Brian Somers
62e85934b8 #ifdef IPPROTO_OSPFIGP before expecting it to be defined.
This unbreaks OpenBSD.
1999-08-02 15:29:19 +00:00
Brian Somers
2faae814fb Filter ospf and igmp separately.
Kind-of submitted by: phk
1999-08-02 11:53:16 +00:00
Brian Somers
12197c9e76 Mention which rfc the DNS/NBNS IPCP extensions come from. 1999-07-29 14:37:26 +00:00
Brian Somers
7722ec20ee Don't return a garbage mbuf pointer after storing it
as an unresolved fragment.
1999-07-28 19:39:00 +00:00
Brian Somers
804c097b9e Fix a load of typos
Use sizeof, not a hardcode value.

Some of it submitted by:  Peter Jeremy <jeremyp@gsmx07.alcatel.com.au>
1999-07-28 03:01:52 +00:00
Brian Somers
cad7e7426a o Overhaul filtering, adding facilities to jump over rules and to
negate the sense of rules.
o Remove the redundant (and undocumented) ``host'' and ``port''
  words (README.changes updated).
o Don't permit (and ignore) garbage instead of the protocol.

Mostly submitted by:  Peter Jeremy <jeremyp@gsmx07.alcatel.com.au>
1999-07-27 23:44:00 +00:00
Brian Somers
8d14e328f9 If we've negotiated CBCP and have also specified ``none'' as a possible
callback option, and the server sends us CBCP_NONUM, proceed directly
to the network phase rather than insisting on our configured CBCP
option.

Mostly submitted by: kkphang <phang@dgate.po.my>
1999-07-27 13:47:59 +00:00
Brian Somers
83a18abc10 Be a bit more consistent with variable names. 1999-07-27 00:30:32 +00:00
Brian Somers
b4d797e707 Fix an off-by-one error and correct the man page WRT clearing
filters.

Submitted by:	Peter Jeremy <peter.jeremy@alcatel.com.au>
PR:		12437
1999-07-26 11:15:11 +00:00
Brian Somers
ef8fcfa7f2 When we fetch previously retrieved IP fragments from the alias
tables, copy them correctly back into our mbuf rather giving a
bzero'd count to memcpy() and ending up with a 0 byte fragment.

The old code resulted in a 0 byte write to the tun device which
tickled a bug that resulted in a panic :-(
1999-07-24 02:53:39 +00:00
Brian Somers
02ad5579d0 Fix a typo
Submitted by:	Rich Wood <rich@chugaboom.net>
1999-07-17 10:33:57 +00:00
Brian Somers
55b04d88d5 Don't declare `end' if we aren't compiling radius support. 1999-07-15 02:02:51 +00:00
Brian Somers
ad21dff290 Oops - add a missing cast. 1999-07-10 00:08:19 +00:00
Brian Somers
32bd4110d5 Leap through one more hoop to avoid alignment problems. 1999-07-10 00:03:58 +00:00
Brian Somers
ddd6808024 Don't bother read()ing if we ``expect'' nothing in our chat script. 1999-06-26 02:54:36 +00:00
Brian Somers
6a32b41413 If we run out of chat script immediately after a successfully executed
expect-send-expect sequence, finish gracefully, don't core dump.
This bug has been there for over a year - I could never reproduce it !

Straw provided by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
1999-06-26 02:54:24 +00:00
Brian Somers
1f9e5fe5fa Support `igmp' filters.
Mostly submitted by: Timo Geusch <freebsd@sleepycat.ukpeople.net>
1999-06-23 16:48:24 +00:00
Brian Somers
6ca65df0a7 Disable TUNSLMODE when we first open the tun device.
Submitted by: Ian West <ian@niw.com.au>
1999-06-22 11:31:42 +00:00
Brian Somers
08da4867ae Don't use the ``next'' redial timer if we have no phone number at all. 1999-06-18 13:49:01 +00:00
Brian Somers
ec3026b6f7 Come up with something useful when someone searches for
``dynamic IP''.
1999-06-14 10:12:41 +00:00
Brian Somers
ad227d8bcc Show the correct error if we fail to open a device. 1999-06-11 13:28:29 +00:00
Brian Somers
fbe3e6af84 Describe why a ``magic'' enddisc is not always a good idea. 1999-06-11 11:27:18 +00:00
Brian Somers
5dfb9210ae Allow reserved substitution strings to be escaped by preceeding them
with a backslash.
1999-06-10 09:34:57 +00:00
Brian Somers
194c225d5c Never bring a link back up after receiving a terminating signal,
don't rely on already being in PHASE_DEAD.
1999-06-10 09:06:30 +00:00
Brian Somers
9afe6bdaee Allow a remote IP and port range specification in the
``alias port'' command.
1999-06-10 00:17:27 +00:00
Brian Somers
ab959eb2b3 Initialise `mp'. 1999-06-09 20:27:26 +00:00
Brian Somers
7063995c94 Allow our endpoint discriminator to be enabled, disabled, accepted
and denied.  This is necessary for some MP implementations that
get confused if you accept their endpoint discriminator but reject
their MRRU.
1999-06-09 16:54:04 +00:00
Brian Somers
8fb106c674 Use the correct pid when substituting PROCESSID.
Problem reported by: Amedeo Beck Peccoz <gea@gressoney.it>
1999-06-09 08:47:36 +00:00
Brian Somers
68645f3954 Don't use static variables if we don't have to. 1999-06-08 20:12:06 +00:00
Brian Somers
c506ecd549 Don't drop the last character from lines in ppp.secret unless it's '\n'. 1999-06-08 20:11:53 +00:00
Brian Somers
aa8574707e Don't IPCP TLD if we're already doing it. This prevents
recursion by doing something like ``down'' or ``quit all''
in ppp.linkdown.
1999-06-08 11:58:27 +00:00
Brian Somers
b12ce35537 Make the `load'', dial'' and `open'' commands a big clearer.
Requested by: Michael Heitmeier <MICHAEL_HEITMEIER@HP-Germany-om12.om.hp.com>
1999-06-08 11:57:59 +00:00
Brian Somers
f5a99677a3 Correct the way ppp transfers links on the server side in MP
mode by padding out the ``struct device'' to the maximum
device size.
Bump the ppp version number to indicate the transfer format
change.

This should make MP over tty and udp devices functional again.
1999-06-05 21:36:00 +00:00
Brian Somers
64e0f466ce Fix some MP sequence number comparison bogons that are tickled by
having different speed links in a bundle.  This would manifest itself
by having the link occasionally hang, but revive when a new connection
is made....
Make ``show mp'' a bit prettier.
1999-06-03 13:29:32 +00:00
Brian Somers
fa0d521656 Oops, quieten a compiler warning. 1999-06-02 23:06:21 +00:00
Brian Somers
0d4fe7a80f Mention physical and sync logging in the ``set log''
usage message.
1999-06-02 21:28:02 +00:00
Brian Somers
411675bae3 o Alter the mbuf type as it's processed by different layers.
o Show more information about missing MP fragments in ``show mp''.
o Do away with mbuf_Log().  It was showing mbuf stats twice on
  receipt of LCP/CCP/IPCP packets.... ???!!?
o Pre-allocate a bit extra when creating LQR packets to avoid having
  to allocate another mbuf in mbuf_Prepend().
1999-06-02 15:59:09 +00:00
Brian Somers
ac685e314f Introduce the ``keep-session'' option. Refer to the man
page for details.  This allows MP over non-tty devices where
the original ppp process must not exit (such as sshd-spawned
ppp sessions).
1999-06-02 00:46:55 +00:00
Brian Somers
e6923505ee Increase the length of an individual device name to LINE_LEN.
Adjust the base physical device name correctly after a link
transfer (allowing correct multilink callbacks).
1999-06-01 19:08:59 +00:00
Brian Somers
ba16c8408d Make async/sync/physical/hdlc dumps prettier by showing printable
characters at the end of the line in hexdump style.
1999-06-01 16:01:48 +00:00
Brian Somers
d7452b10bd Mention that using MYADDR and HISADDR with ``set filter''
will result in the rules being updated any time MYADDR
or HISADDR change.
1999-06-01 08:46:53 +00:00
Brian Somers
1d1fc0171e Remember if MYADDR or HISADDR is used in a filter add tweak all
filters any time either value changes.
1999-05-31 23:57:40 +00:00
Brian Somers
65cec6e754 Don't forget to free the mbufs that get processed by
mp_Assemble().
Leak spotted by: louqi
1999-05-28 08:03:24 +00:00
Brian Somers
2b14671a9d Handle unterminated quoted strings without dup'ing the last character
with an out-by-one-memcpy.
1999-05-27 16:51:47 +00:00
Brian Somers
4d9c2bb9ae Add some comments, optimise out a few strlen()s and
remove a few extraneous assignments.
1999-05-27 09:50:10 +00:00
Brian Somers
d0b3b745ba Call tty_Offline() from tty_Cooked() and tty_Free(), just in
case ppp is abending and hasn't called physical_Offline()
already.
1999-05-27 08:42:49 +00:00
Brian Somers
4e5196e9dc Move the code for tweaking interface flags into one function. 1999-05-27 08:42:17 +00:00
Brian Somers
acbd1f00fd Correct the ``ignoring sync/async'' warnings so that they show
up with the correct device type.
Reassign the correct tcpdevice or execdevice after transfering
a link in MP server mode.
1999-05-24 16:39:17 +00:00
Brian Somers
26e64ed9d4 Don't warn about ``!'' lines being unindented commands in ppp.conf. 1999-05-24 09:04:35 +00:00
Brian Somers
9950fb2a00 Move the tty locking stuff back out to physical.c so
that we lock the device *before* we open it.
We still open the device only once - and then ask all
our handlers if they know how to handle it.
1999-05-18 01:37:46 +00:00
Brian Somers
9b898a03d8 Mention ``show layers'' 1999-05-16 13:39:03 +00:00
Brian Somers
4b698945d4 Initialise ttydevice::Timer 1999-05-16 11:58:48 +00:00
Poul-Henning Kamp
00a7225817 Be more non-crypto friendly at make release time. 1999-05-15 19:21:15 +00:00
Brian Somers
4faec43070 Add ``show layers'' to see the protocol layering for a link. 1999-05-15 02:24:18 +00:00
Brian Somers
6471628d59 Handle LCP echo reqs properly again (broken with the
layering changes).
1999-05-14 09:36:06 +00:00
Brian Somers
76d9853864 Ensure that we're not going to overflow our ``struct tun''
when we mbuf_Read() into it.
Add the link name to a few diagnostics.
1999-05-14 09:35:51 +00:00
Brian Somers
27be3ac662 Initialise the struct device part of struct ttydevice. 1999-05-13 19:29:40 +00:00
Brian Somers
8dbb1e2bfd Fix a bum pointer dereference and make some variable
names more consistent.
Stack trace supplied by: Joe Clarke <jclarke@cisco.com>
1999-05-13 16:35:13 +00:00
Brian Somers
ac37ab22eb Ignore repeated signals sent to the parent in background
mode.
1999-05-13 16:34:57 +00:00
Brian Somers
d543a9c02a Adjust our first timer delta according to the return
from getitimer() so that times are correct for
``show timer''.
1999-05-12 19:10:22 +00:00
Brian Somers
ef868a34ad Oops - hook the sync push diagnostics correctly. 1999-05-12 09:54:33 +00:00
Brian Somers
6815097bf7 Allow `host:port/udp'' devices and support `host:port/tcp'' as
being the same as the previous (still supported) ``host:port''
syntax for tcp socket devices.

A udp device uses synchronous ppp rather than async, and avoids
the double-retransmit overhead that comes with ppp over tcp (it's
usually a bad idea to transport IP over a reliable transport that
itself is using an unreliable transport).  PPP over UDP provides
througput of ** 1.5Mb per second ** with all compression disabled,
maxing out a PPro/200 when running ppp twice, back-to-back.

This proves that PPPoE is plausable in userland....

This change adds a few more handler functions to struct device and
allows derivations of struct device (which may contain their own
data etc) to pass themselves through the unix domain socket for MP.
** At last **, struct physical has lost all the tty crud !

iov2physical() is now smart enough to restore the correct stack of
layers so that MP servers will work again.

The version number has bumped as our MP link transfer contents have
changed (they now may contain a `struct device').

Don't extract the protocol twice in MP mode (resulting in protocol
rejects for every MP packet).  This was broken with my original
layering changes.

Add ``Physical'' and ``Sync'' log levels for logging the relevent
raw packets and add protocol-tracking LogDEBUG stuff in various
LayerPush & LayerPull functions.

Assign our physical device name for incoming tcp connections by
calling getpeername().

Assign our physical device name for incoming udp connections from
the address retrieved by the first recvfrom().
1999-05-12 09:49:12 +00:00
Brian Somers
229c76251b Revert to the previous behaviour of only doing a utmp
login if we're -direct on a tty device.
1999-05-09 20:13:52 +00:00
Brian Somers
3377c28cd9 Deal with the fact that as we now mbuf_Read the fsm
header in fsm_Input() we often end up with a NULL mbuf.

Deal with a possible NULL mbuf being passed into
mbuf_Prepend().

Adjust some spacing to make things more consistent.
1999-05-09 20:02:29 +00:00
Brian Somers
5d9e610366 o Redesign the layering mechanism and make the aliasing code part of
the layering.

  We now ``stack'' layers as soon as we open the device (when we figure
  out what we're dealing with).  A static set of `dispatch' routines are
  also declared for dealing with incoming packets after they've been
  `pulled' up through the stacked layers.

  Physical devices are now assigned handlers based on the device type
  when they're opened.  For the moment there are three device types;
  ttys, execs and tcps.

o Increment version number to 2.2
o Make an entry in [uw]tmp for non-tty -direct invocations (after
  pap/chap authentication).
o Make throughput counters quad_t's
o Account for the absolute number of mbuf malloc()s and free()s in
  ``show mem''.
o ``show modem'' becomes ``show physical''.
1999-05-08 11:07:56 +00:00
Brian Somers
315164071c Handle receiving more than one acceptable CCP REQ
during one negotiation session without REJecting
everything from the second REQuest.
1999-05-02 14:33:39 +00:00
Brian Somers
3de29bbf70 Mention ``show mp''.
Describe ACFComp correctly.
1999-05-02 08:52:50 +00:00
Brian Somers
22d1222bab Make ports 80 & 81 ``interactive''. 1999-05-01 11:31:29 +00:00
Brian Somers
a8d7acdc03 Change ``set device'' so that it parses its arguments as one
device per argument rather than the old way of concatenating
everything then splitting the result at commas and whitespace.

Old syntax of ``set device /dev/cuaa0, /dev/cuaa1''
may no longer contain the comma, but syntax such as
``set device "!ssh host ppp -direct label"'' is now
possible.
1999-04-27 00:23:57 +00:00
Brian Somers
7884358fdd Add support for NetBSD 1999-04-26 08:54:34 +00:00
Brian Somers
119386a38b #include <errno.h>, not <sys/errno.h> 1999-04-26 08:54:25 +00:00
Brian Somers
7c6b3a5704 Spelling police 1999-04-23 13:45:50 +00:00
Brian Somers
28e610e378 int -> size_t 1999-04-21 08:13:25 +00:00
Brian Somers
a38cc90182 Split the recorded chap challenge into two - one for the
receiver and one for the sender.  This allows two simultaneous
chap conversations - something that I *thought* I was already
doing on a daily basis myself until the existence of the
problem was
Beaten into me by: sos
1999-04-21 08:03:51 +00:00
Brian Somers
1599fce5c6 If ioctl TIOCMGET fails, continue. The device may be
a pseudo device created by an interactive version of
rlogin/telnet/ssh & friends
1999-04-21 08:03:35 +00:00
Brian Somers
4ae29eb73c Revert the ACCMAP changes where we OR the peers accmap
with our own if there are differing bits (last two revisions
of lcp.c).  This change broke at least one negotiation
session.
Instead, we just use an OR of the two accmap values when
we're doing the ASYNC framing.
1999-04-11 08:51:04 +00:00
Brian Somers
0ca6f91b84 When going from DATALINK_HANGUP directly to
DATALINK_OPENING, don't forget to change phase
to ESTABLISH if we're currently TERMINATE'ing.
Helped locate by: Chuck Robey <chuckr@mat.net>
1999-04-06 14:48:10 +00:00
Brian Somers
5945a079eb When we get an LCP TLU, go into PHASE_AUTHENTICATE
from any other phase besides PHASE_NETWORK, otherwise
there's a chance that we end up sending auth packets
and dropping the replies.
1999-04-05 21:52:10 +00:00
Brian Somers
0b19fc6d3f Remove forgotten variable. 1999-04-03 12:01:38 +00:00
Brian Somers
e304484545 Handle the detection of frames even if we read them
with more than one read().  When we detect one, don't
forget to pass it to async_Input() and drop our
terminal back into command mode.

Don't output an extraneous \r if we're passed \r\n
to prompt_vprintf in raw mode.
1999-04-03 11:54:00 +00:00
Brian Somers
29b873f38d Drop PAP & CHAP packets if we're not in NETWORK or AUTHENTICATE
phase.
1999-04-01 11:05:23 +00:00
Brian Somers
eb2d27cfc3 Avoid a few warnings on the alpha 1999-03-31 14:21:46 +00:00
Brian Somers
32c75b7dab Oops - remove register keyword 1999-03-31 13:44:07 +00:00
Brian Somers
d3b121132a Another alignment bogon. 1999-03-31 13:33:43 +00:00
Brian Somers
c2b0f58ca3 Point at cs.slcs_u.csu_ip instead of the just-copied ``cp''
when recalculating the ip checksum.  cp is not guaranteed to
be aligned.  It now doesn't matter that cp isn't aligned as
the caller does another mbuf_Alloc() regardless.
1999-03-30 07:57:22 +00:00
Brian Somers
486105bcb0 Maintain a `necessary' marker to indicate that we *probably*
need to process a signal (usually a SIGALRM).  Check to see
if we need to process a signal both before *and* after calling
select() as older (pre-2.0) versions of ppp used to.

This handles the possibility that ppp may block at some
point (maybe due to an open() of a misconfigured device).
Previously, we'd potentially lock up in select().

The `necessary' marker reduces the increased signal checking
overhead so that at full speed with no compression transferring
an 83Mb file via a ``!ppp -direct'' device, we get a 1%
throughput gain.
1999-03-30 00:44:57 +00:00
Brian Somers
a2bc4c59c3 If we adjust our required ACCMAP due to a more restrictive
ACCMAP being REQuested by the peer, also increment our FSM
id so that we don't end up sending out a new REQ with the
same ID and different data (the changed ACCMAP).
1999-03-29 08:21:40 +00:00
Brian Somers
aad80d9f1b Ensure that the thing we're casting to struct ip
is aligned for non-i386 architectures.
1999-03-29 08:21:28 +00:00
Brian Somers
fe3094cdd7 Allow port ranges in ``alias port''. 1999-03-25 23:36:25 +00:00
Brian Somers
0f203c7e2e Undo possible damage done by the new TUNSIFMODE ioctl
in FreeBSD-current.
1999-03-25 11:37:51 +00:00
Brian Somers
4a948cab8b Do away with some literal text that is never switched
off - I *think* these were groff bugs.
1999-03-19 09:00:08 +00:00
Brian Somers
24a6ccfc38 Replace hardcoded quoting with Sq or Dq. 1999-03-19 01:42:45 +00:00
Brian Somers
521e2a5300 Don't forget to fully initialise the configured values
for MYADDR and HISADDR in ``set ifaddr'' so that unspecified
values don't end up retaining their `width'.
1999-03-19 00:05:32 +00:00
Brian Somers
8b9e9093a0 Use ``Sx'' when xref'ing sections. 1999-03-18 21:53:56 +00:00
Brian Somers
7919e54037 Remove all remaining [ and ] characters (and do things properly). 1999-03-18 21:50:52 +00:00
Brian Somers
38ab56c440 Remove all hardcoded [...] syntax.
With help from: Daniel C. Sobral <dcs@newsguy.com>
1999-03-17 00:25:43 +00:00
Brian Somers
516bf2ccb8 Mention changes to the default authentication behaviour. 1999-03-16 11:54:02 +00:00
Brian Somers
615beb1f86 Detect pred1 packets where the length != the packet length
Use a maximum of MAX_MRU + 2 bytes for incoming packets, not
MAX_MTU + 2.
Tidy up some diagnostics.
1999-03-16 01:24:23 +00:00
Brian Somers
a36ca3cc08 Tone down the log levels (Log{ERROR,WARN} -> LogCCP)
when we've simply missed a packet.

When our Predictor1 CRC is wrong (implying we've dropped
a packet), don't send a ResetReq().  Instead, send another
CCP ConfigReq().  *shrug*  My tests show this as being far
worse than the ResetReq as we may have further Nak/Rejs etc
and we're basically resetting both our incoming and outgoing
compression dictionaries, but rfc1978 says the ConfigReq is
correct, so we'd better go along...
1999-03-11 01:49:15 +00:00
Brian Somers
1322e9adf8 If /etc/ppp/ppp.conf doesn't exist, mention that the
configuration file can't be found rather than saying
that the label can't be found.
Pointed out by: Greg Black <gjb@comkey.com.au>
1999-03-09 20:39:03 +00:00
Brian Somers
661a0e900d Don't destroy the old server socket another ``set server''
call fails.
1999-03-08 22:35:19 +00:00
Brian Somers
bf1d816501 Don't forget to call modem_Found() when connecting
via an external program - otherwise we get no
throughput stats and connection count increase.
1999-03-07 20:58:48 +00:00
Guy Helmer
d5f39fc1d1 Add leading 0 in front of octal file permissions number.
OK'ed by:	Brian Somers <brian@freebsd.org>
PR:		docs/9843
1999-03-07 20:27:45 +00:00
Brian Somers
50a63ab997 Support PPTP via libalias (``alias pptp addr''). 1999-03-07 18:13:44 +00:00
Brian Somers
d318fe8e17 Support proxying & transparent proxying curtesy of libalias(3).
Order the alias command descriptions.
Order the SEE ALSO entries.
1999-03-07 15:02:38 +00:00
Brian Somers
a39fd2143c Correctly drop existing connections when reopening the diagnostic
socket.
1999-03-07 11:54:43 +00:00
Brian Somers
4be0e57de1 Read from fd[0] and write to fd[1] where `fd' is the
result of a pipe().  This matters under OpenBSD.
1999-03-07 01:41:40 +00:00
Brian Somers
da42fa6060 Use socketpair() instead of pipe()... pipe() doesn't return
two bi-directional descriptors under OpenBSD.
1999-03-07 01:41:27 +00:00
Brian Somers
a611383fee Reopen descriptor 0 as /dev/tty when in interactive mode
in OpenBSD as well as FreeBSD (I still don't know why).
Add a debug diagnostic when creating a child process as
a link.
1999-03-07 01:02:39 +00:00
Brian Somers
c11e57a340 Extend the ``set redial'' command to allow incremental
redial timeouts.
1999-03-04 17:42:15 +00:00
Brian Somers
bc76350ef9 Correct some ntohl/htonl bogons in the netmask handling.
This was pretty harmless as netmasks on a POINTOPOINT
interface are pretty much ignored, but it looked funny.

Mention the configured netmask in ``show ipcp''.

Describe in more detail what a proxy arp entry is.
1999-03-03 23:00:41 +00:00
Brian Somers
536d5b3331 When negotiating ACCMAPs, sync our ACCMAP with the
peers by ORing the two together and NAKing or REQing
the result rather than allowing seperate local/peer
values.
If the peer REJs our ACCMAP and our ACCMAP isn't 0,
warn about it and ignore the rejection.
1999-03-01 13:46:45 +00:00
Brian Somers
8a8d99276f Comment why we do a TLF when we get a ``Down'' event in state
``closing''.

Pointed out by: archie

Don't do a TLF when we get a ``Catastrphic Protocol Reject'' event
in state ``closed'' or ``stopped''.

Pointed out but not suggested by: archie

This makes no difference in the current implementation as
LcpLayerFinish() does nothing but log the event, but I disagree
in principle because it unbalances the TLF/TLS calls which
(IMHO) doesn't fit with the intentions of the RFC.

Maybe the RFC author had a reason for this.  It can only happen
in two circumstances:

- if LCP has already been negotiated then stopped or closed and we
  receive a protocol reject, then we must already have done a TLF.
  Why do one again and stay in the same state ?

- if LCP hasn't yet been started and we receive an unsolicted
  protocol reject, why should we TLF when we haven't done a TLS ?
1999-03-01 02:52:39 +00:00
Brian Somers
ec5e7f36dc Bring up auto links despite there being no data queued if
we're already in network phase and our autoload values
are set with no minimum threshold (the default).

Tell the autoload timer that it's ``coming up'' *before*
calling AutoLoadTimeout() directly... not after.  This
prevents the very first demand-dial connection from
immediately disconnecting when there are other auto links.

Problem diagnosis:  Ted Mittelstaedt <tedm@toybox.placo.com>
1999-03-01 00:43:48 +00:00
Brian Somers
479508cf28 Allow control over the number of ConfigREQ & TermREQ attempts
that are made in each of the FSMs (LCP, CCP & IPCP) and the
number of REQs/Challenges for PAP/CHAP by accepting more arguments
in the ``set {c,ip,l}cpretry'' and ``set {ch,p}apretry'' commands.

Change the non-convergence thresholds to 3 times the number of configured
REQ tries (rather than the previous fixed ``10'').  We now notice
repeated NAKs and REJs rather than just REQs.

Don't suggest that CHAP 0x05 isn't supported when it's not configured.

Fix some bugs that expose themselves with smaller numbers of retries:
o Handle instantaneous disconnects (set device /dev/null) correctly
  by stopping all fsm timers in fsm2initial.
o Don't forget to uu_unlock() devices that are files but are not
  ttys (set device /dev/zero).

Fix a *HORRENDOUS* bug in RFC1661 (already fixed for an Open event in state
``Closed''):
  According to the state transition table, a RCR+ or RCR- received in
  the ``Stopped'' state are supposed to InitRestartCounter, SendConfigReq
  and SendConfig{Ack,Nak}.  However, in ``Stopped'', we haven't yet
  done a TLS (or the last thing we did is a TLF).  We must therefore
  do the TLS at this point !

  This was never noticed before because LCP and CCP used not use
  LayerStart() for anything interesting, and IPCP tends to go into
  Stopped then get a Down because of an LCP RTR rather than getting a
  RCR again.
1999-02-26 21:28:14 +00:00
Brian Somers
26baedc5e4 Parse IP addresses more securely - specifically, don't allow
a bum name to return as 0.0.0.0... we don't want ``delete xxx''
to delete the default route when xxx doesn't resolve.

Support IP number specifications as the host when specifying
a tcp-style device (rather than *just* hostnames).
1999-02-25 20:05:55 +00:00
Brian Somers
b5c347a37a When our dial timeout is ``random'', display its value
correctly by invoking the timer to get the value before
displaying the message.
Don't assume that a value of 0 is ``random'' in
``show datalink''.
Make the random value between 1 and DIAL_TIMEOUT rather
than between 0 and DIAL_TIMEOUT-1
1999-02-25 12:00:04 +00:00
Brian Somers
f4007327ae Don't immediately bring auto links back up in multilink
mode (when there is more than one auto link) if there is
no data queued to go out.
Reviewed by: Tom Torrance <tom@tomqnx.com>
1999-02-25 11:59:36 +00:00
Brian Somers
b7ff18add2 Handle empty PAP & CHAP packets (containing only an FSM header).
Some CHAP implementations send no welcome message with their
SUCCESS/FAILURE packets.  This was being mis-identified as
a truncated packet by the new authentication code :-(
1999-02-20 01:12:45 +00:00
Brian Somers
b31a24cad8 Be a little more verbose about dodgy looking authentication
packets before dropping them in the bit-bucket.
1999-02-19 10:48:42 +00:00
Brian Somers
f522bee006 Build correctly when -DNOCRYPT is used. 1999-02-18 19:45:06 +00:00
Brian Somers
4043c04fa5 Don't expect a chap response if we haven't negotiated
chap 0x80.
1999-02-18 19:11:46 +00:00
Brian Somers
5e31549897 Fully support both NT and LANMan CHAP type 0x80 as both
authenticator and authenticatee.
1999-02-18 00:52:15 +00:00
Brian Somers
64cfdfc6fb Nuke any remaining auth timers when datalinks come back down
to DATALINK_LCP.
1999-02-17 02:11:28 +00:00
Brian Somers
6b4286e0f5 Wait by default for one second after the login script
is complete before checking carrier.  If it's there,
the device supports carrier.  If it's not it doesn't.

Add the ``set cd'' command for deciding how soon to check
for carrier, and for deciding if carrier is REQUIRED.

The default has changed:  Pre 2.0 versions of ppp waited
for 1 second.  Version 2 didn't wait, but this causes
problems with some (few?) modems that don't assert carrier
immediately on reporting CONNECT.  The one second delay
is back now and can be removed with ``set cd 0''.

Bump the ppp version number in case this needs to be changed
again....
1999-02-16 00:16:56 +00:00
Brian Somers
9576e3690f Describe manual dialing in greater detail.
Mention more rfc numbers.
Don't ``.Nm Ppp'' (just use ``.Nm'').
1999-02-14 12:16:41 +00:00
Brian Somers
a8103305cb When executing a command as part of a dial/login/hangup
script, expand words in the same way as !bg does.
1999-02-12 00:52:30 +00:00
Brian Somers
00b001185c /etc/ppp/ppp.*.sample -> /usr/share/examples/ppp/ppp.*.sample 1999-02-11 16:34:15 +00:00
Brian Somers
58330d7bfa When resending chap challenges, resend the same challenge
each time rather than making up a new one.

Increase the authname/authkey max sizes to 100 characters.

Allow ``authkey'' specifications beginning with ``!''.
When a challenge is received, the text following the
``!'' is executed as a program (expanding stuff in the same
way that ``sh'' and ``!bg'' do).  The program is passed the
peer name, peer challenge and local ``authname'' on standard
input and is expected to output the name/key combination that
should be used to build the CHAP response.

This provides support for Secure ID cards (guess what I was
given at work recently!) using CHAP.

Examples will follow.
1999-02-11 10:14:08 +00:00