Paul Mackerras [Tue, 12 Jul 2005 01:09:05 +0000 (01:09 +0000)]
Stop the charshunt process after running the disconnector,
rather than immediately a signal is received. With this change
we can send a SIGHUP to pppd and actually have it do the
LCP TermReq/TermAck exchange.
Paul Mackerras [Tue, 12 Jul 2005 01:07:59 +0000 (01:07 +0000)]
Bring up the link on an explicit call from main() rather than
doing it in link_required(). With the old way, it was restarting
the link in the middle of link_terminated().
Paul Mackerras [Sun, 10 Jul 2005 07:31:26 +0000 (07:31 +0000)]
Fix the rechallenge behaviour. Previously, once it sent a rechallenge,
it would ignore the response (except to send a reply with a bogus
message) and retransmit the rechallenge every 3 seconds until it
eventually timed out and took down the link.
Paul Mackerras [Sat, 9 Jul 2005 09:12:48 +0000 (09:12 +0000)]
Don't set the interface MTU in PPPOESendConfig, in fact get rid of
it altogether, and instead set the wanted MRU and allowed MTU to
1492 before starting negotiation.
James Carlson [Sun, 26 Jun 2005 19:34:41 +0000 (19:34 +0000)]
Fixed configure breakage in $archvariant support for Solaris
introduced by fix in RCS ID 1.33 -- failed to configure for WorkShop C
compiler correctly because test was changed from -f (file exists) to
"$archvariant" (variable is non-null).
Fixed ccp.c compilation warnings due to missing argument type in RCS
ID 1.48 fix.
James Carlson [Wed, 4 May 2005 21:31:20 +0000 (21:31 +0000)]
Fix for Sun CR 6257917: the right prefix length for an interface token
is 64 bits, not 10. (10 came from the prefix length of a link-layer
address, but it's not actually used by SIOCSLIFADDR, so it wasn't right
in any case.)
Paul Mackerras [Tue, 22 Mar 2005 09:53:53 +0000 (09:53 +0000)]
From Marco D'Itri.
This is a fix for #294232.
If pppd recognized the peer not to ask for encryption in
his initial offer, it refused any further negotiation.
This change tells the peer using a ConfNak what
encryption options we're able to accept.
This makes the peer send a new ConfReq, usually with
one of the options we're able to accept.
Paul Mackerras [Fri, 31 Dec 2004 11:58:56 +0000 (11:58 +0000)]
Call lcp_close(0) in link_required if the channel connect or
establish_ppp functions fail. It's a bit grotty but it is needed
to get lcp back into closed state so that a future lcp_open will
do what it should.
Paul Mackerras [Fri, 31 Dec 2004 11:49:22 +0000 (11:49 +0000)]
Don't close pty_slave and real_ttyfd in connect_tty if an error
occurs; link_required calls cleanup_tty if connect_tty returns
an error, and that does the closing. Doing the closes in connect_tty
meant that the disconnector couldn't run and the tty mode couldn't
be restored.
Paul Mackerras [Mon, 15 Nov 2004 22:13:26 +0000 (22:13 +0000)]
Get rid of the MS_ChapResponse and MS_Chap2Response structures.
Using a struct to represent an on-the-wire format is basically
broken, since the compiler can add padding between members or
assume alignment for the struct. Instead we just use arrays
of unsigned char and define offsets in the arrays for the various
fields.
James Carlson [Mon, 15 Nov 2004 00:57:54 +0000 (00:57 +0000)]
Cut down on spam from Solaris ppp kernel bits: unknown DLPI primitives
(as encountered on Solaris 10) aren't errors, and need to flush out any
queued up (undecoded) data on the read side after pushing ppp_ahdlc.
Paul Mackerras [Sun, 14 Nov 2004 07:26:26 +0000 (07:26 +0000)]
Simplified and cleaned up the radiusclient implementation, and
made it use pppd facilities where relevant. All the bits of
radiusclient that we actually need are now in the plugins/radius
directory.
Paul Mackerras [Sat, 13 Nov 2004 12:22:49 +0000 (12:22 +0000)]
Correctly escape or unescape hypens in the man pages.
Without this patch "-" is rendered as the endash in unicode
consoles and then bad things happen. From Marco d'Itri.
Paul Mackerras [Sat, 13 Nov 2004 12:07:29 +0000 (12:07 +0000)]
Exit with an error if both demand and notty are given.
Don't require a connect script with demand if we are using
the pty or socket options.
Enforce the connect_delay if we are using the socket option.
Paul Mackerras [Sat, 13 Nov 2004 02:28:15 +0000 (02:28 +0000)]
Add a 'treat as reject' parameter to the nakci functions.
Use it to make sure we don't keep requesting the same IP
address over and over when it keeps getting nacked.
Paul Mackerras [Fri, 12 Nov 2004 10:30:51 +0000 (10:30 +0000)]
Multilink improvements. This involved moving some logic from the
main loop in main.c into link_required() and link_terminated() in
auth.c and adding code to multilink.c. We now make a tdb entry
with the list of pppd pids for all the links in the bundle, and the
master pppd uses this to send a SIGHUP to each one when the bundle
is terminated.
We still have one pppd controlling both the bundle and the first link,
but when that link goes down, assuming that other links still exist,
the first link's pppd will clean up after that link but then stay
running until all the links have disconnected. So it is possible to
lose the first link without losing the bundle.
This requires a small kernel patch which I will be sending to the
kernel maintainers shortly.
Paul Mackerras [Mon, 8 Nov 2004 11:45:59 +0000 (11:45 +0000)]
Fix an infinite negotiation loop where we would respond to a
configure-reject for the IPCP Addresses option with another
IPCP configure-request containing the Addresses option.
Paul Mackerras [Thu, 4 Nov 2004 10:02:26 +0000 (10:02 +0000)]
Remove the requirement that redistributions in binary form reproduce
the copyright conditions in documentation from my copyright notice.
It still remains in CMU's and others' copyright notices.
Paul Mackerras [Thu, 4 Nov 2004 09:46:50 +0000 (09:46 +0000)]
Add a timeout when waiting for child processes to exit before pppd
exits. Send a SIGTERM to the child processes if the timeout expires
or if pppd gets a SIGTERM or SIGINT itself.
Paul Mackerras [Mon, 1 Nov 2004 09:31:07 +0000 (09:31 +0000)]
Use Makedefs.com rather than solaris/Makedefs, since Makedefs.com
has @DESTDIR@ etc. substituted.
Move installation of kernel modules to a install-modules target
so that it can be compiled and installed in an alternate directory
as non-root for the build farm.
Paul Mackerras [Sun, 31 Oct 2004 22:23:18 +0000 (22:23 +0000)]
Remove dependencies on CHAPMS definition in header files.
Fix bug in filling in mdtype field when we NAK and suggest CHAP.
Ask for/suggest MD5 before MSCHAP{v2,} digest.
Paul Mackerras [Fri, 29 Oct 2004 00:12:27 +0000 (00:12 +0000)]
Add --prefix and --sysconfdir options to configure, and put
@DESTDIR@ and @SYSCONF@ tags in various Makefile.linux files.
These tags get expanded by configure.
Paul Mackerras [Thu, 28 Oct 2004 00:33:47 +0000 (00:33 +0000)]
Patch from Robert Vogelgesang:
This patch enables plugins called via hooks/notifiers triggered
by this call to lcp_close() to see status set here.
Otherwise (i. e. without this patch) the RADIUS plugin has
no chance to set the attribute PW_ACCT_TERMINATE_CAUSE to the
value PW_ACCT_SESSION_TIMEOUT.
Paul Mackerras [Thu, 28 Oct 2004 00:32:32 +0000 (00:32 +0000)]
Patch from Robert Vogelgesang:
This patch fixes the link statistics for connections that
go through multiple IPCP up-down cycles. Such connections
happen typically in a setup where pppd is used as a back-end
by a L2TP daemon, in case the PPP session at the other side
of the L2TP tunnel reconnects, but the L2TP daemon at that
side just reuses the old L2TP tunnel instead of creating a
new one.
The patch is most important when RADIUS accounting is in use:
Each IPCP-down initiates a RADIUS-Accounting-Stop packet, which
indicates the end of a session. Without this patch, the
accounting information in each subsequent RADIUS-Accounting-Stop
packet of the very same connection would contain cumulative
data since the connection start, but not the data of the last
"sub-session"; in other words, the accounting data sent to
the RADIUS server would indicate that the client had used much
more session time and transfered much more data.
NOTE: The problem fixed by this patch exists even when the
radius plugin is not in use; when extracting accounting data
from the syslog, you can work around the bug, because you
can see there that the same instance of pppd had multiple
sessions; you cannot see this in the RADIUS accounting data.
Furthermore, this patch suppresses duplicate printing/syslogging
of identical data.
Paul Mackerras [Thu, 28 Oct 2004 00:24:40 +0000 (00:24 +0000)]
Patch from Robert Vogelgesang:
This patch does two things:
o It adds some debugging messages.
o "cleanup()" will no longer be added to the link_down_notifier
chain.
The debugging messages are obvious.
The problem with cleanup() in the link_down_notifier chain is only
half-way that there could be cases where the link would go up again
and without a further authentication -- I just don't know if this
can happen. But this part of the patch is a work-around for a
_real_ problem/bug in the radius plugin (not the radattr plugin):
The radius plugin calls functions registered via the
radius_attributes_hook after each PAP authentication (which is
correct), but only after the _first_ successful CHAP authentication
during a session. Subsequent CHAP authentications are performed,
but the radius_attributes_hook will not be processed again.
This can happen in a setup where pppd is used as a back-end
by a L2TP daemon, in case the PPP session at the other side
of the L2TP tunnel reconnects, but the L2TP daemon at that
side just reuses the old L2TP tunnel instead of creating a
new one. In such situations, an incomming follow-up session
via an existing T2TP tunnel would re-use the same instance of
pppd; the incomming CHAP authentication would first tear down
the old session, which in turn would call the link_down_notifier.
When the _subsequent_ CHAP authentication succeeds, there is
currently no call to the function assigned to
radius_attributes_hook (here: print_attributes(); THIS BUG
REMAINS AND NEEDS TO BE FIXED).
To summarize: The radius plugin calls the function registered
via the radius_attributes_hook after _each_ successful PAP
authentication, but only after the _first_ successful CHAP
authentication; radius_attributes_hook _should_ be processed
after _each_ successful CHAP authentication.
I have currently no patch for this bug; furthermore, I should
first contact the author of the radius plugin and ask him,
_why_ he has programmed a special handling of subsequent
CHAP authentications.
With the following patch, the follow-up session can re-use the
radattr-file left over from the previous session, which is OK
in our application, but may cause problems in others.
Note: This is only a problem when CHAP is used; subsequent
sessions authenticated with PAP are OK, with and without this
patch.
Paul Mackerras [Thu, 28 Oct 2004 00:21:48 +0000 (00:21 +0000)]
Patch from Robert Vogelgesang:
This patch avoids duplicate session IDs in RADIUS accounting,
when the same pppd instance has multiple sessions during
the same second. This can happen when you have a really
fast RADIUS server and fast clients, e. g. when using pppd
as a back-end for PPPoE (either directly or via L2TP).
Paul Mackerras [Sun, 24 Oct 2004 23:53:05 +0000 (23:53 +0000)]
Don't prepend /dev/ to a possible device name if it already begins
with '/' (i.e. just check for / instead of /dev/ as before).
This allows /udev/blah to be used as a tty device name.
Requested by Pawel Sakowski.
Paul Mackerras [Sun, 24 Oct 2004 23:31:20 +0000 (23:31 +0000)]
Don't use unsigned long in the SHA1 code; we want 32-bit variables
and unsigned long is 64 bits on 64-bit platforms. Use unsigned int
or u_int32_t instead. Pointed out by Oleg Makarenko.
James Carlson [Wed, 14 Apr 2004 02:39:39 +0000 (02:39 +0000)]
Tested with MS-CHAP and CBCP options on Solaris and added options
to makefile.
Repaired support for use of gcc on Solaris x86 -- 32 bit modules also
need -fno-builtin.
MPPE changes broke plain MS-CHAP; repaired errors and cleaned up
compilation warnings due to char/unsigned char differences with non-gcc
compilers.