Commit Graph

985 Commits

Author SHA1 Message Date
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