Commit Graph

969 Commits

Author SHA1 Message Date
brian
0646335b2f 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
e483373e23 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
80af32c97b depricated -> deprecated + mention the -alias flag status in README.changes 1999-11-29 18:53:43 +00:00
brian
8181bafa69 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
08e4eaabf2 Make -foreground a proper option (allowing ``allow mode foreground'',
``set mode foreground'' etc.
1999-11-28 15:50:08 +00:00
brian
ae1dbed1c2 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
f0003f3456 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
659744dd68 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
0490237359 Don't setuid() 'till we've called ID0setproctitle() 1999-11-23 00:14:50 +00:00
brian
257703c14f Call MkSockNode() as uid 0
Forgotten by: julian
1999-11-21 23:27:23 +00:00
brian
1249128f88 Don't compile NETGRAPH out of ppp for the release crunch 1999-11-20 10:55:27 +00:00
brian
e68cdbf656 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
23eed7f710 Fix ``set proctitle'' by using setproctitle(). 1999-11-17 21:12:35 +00:00
brian
1274c8c833 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
e6e4bcef43 Use modfind() to check if a kld is already loaded.
Submitted mostly by: green
1999-11-16 21:57:34 +00:00
brian
aa69617b79 Don't insist on 4 digit umasks in ``set server''.
Pointed out by: joerg
1999-11-13 16:18:40 +00:00
brian
8e0e122248 Make the meaning of the provider part of the PPPoE device spec clearer. 1999-11-13 16:18:27 +00:00
brian
86a6663de4 Oops, netgraph.o -> ether.o for the RELEASE build. 1999-11-11 02:25:17 +00:00
brian
d8b9f4c9fa 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
f87b3817a2 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
2a704f6cf5 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
18dee1f739 Be a bit smarter when identifying a netgraph node
(don't dereference NULL).
1999-11-09 19:05:48 +00:00
brian
21f1d38d7d 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
63fbdd3588 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
c32eabeda6 Don't zero-pad netgraph node ids
Recommended by: julian
1999-11-07 09:03:45 +00:00
brian
cac81ba45e Support PPPoE
Help (lots) from: julian, archie
Facilities from: ahebert@pubnix.net
1999-11-06 22:50:59 +00:00
brian
faf44b90cf 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
6d6b73fcc1 Don't (unnecessarily) parse wtmp, force ID0logout() to DTRT instead. 1999-10-25 13:31:42 +00:00
brian
eefb16d7c8 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
e9a7ac15d7 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
113b2d5788 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
39e862702c 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
8b3338a1eb Correct a few diagnostics 1999-10-16 13:28:04 +00:00
brian
16dcdca31e 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
179e3b22a2 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
cbc0d92369 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
f0dc30299f 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
c1de2e69b9 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
b98112df4e Revert the 1.44 -> 1.45 change. It doesn't work as expected. 1999-10-08 16:09:15 +00:00
brian
b78d8db347 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
38ec90a9b7 Mention the received/expected magic for dodgy ECHO LQRs. 1999-10-06 23:22:54 +00:00
brian
14fd42d30d 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
f3bceef566 Support GRE packets
Submitted by: Harry Starr <starr@gccs.com.au>
1999-09-30 07:23:13 +00:00
brian
814514a640 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
e86d608444 Typo
Submitted by:	Alex Nash <nash@mcs.net>
1999-09-24 23:57:22 +00:00
brian
672be93090 Allow ``make -DNOKLDLOAD'' 1999-09-22 00:44:45 +00:00
brian
531472ba31 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
cdf842b2df 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
6e5a0a5cc4 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
phantom
353c1a6746 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
463e41d5f8 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
9c54df5d67 NetBSD requires net/if.h for the IFF_* defines (as well as OpenBSD) ! 1999-09-20 07:18:50 +00:00
brian
46ca602b1a 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
7775aefb57 Cosmetic:
alias_cmd -> nat_cmd after a repo-copy
1999-09-08 07:34:52 +00:00
brian
2058967546 We don't need a queue for *CP data - these are IP-only queues. 1999-09-07 14:34:55 +00:00
brian
3157f75de6 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
ea21e67db9 Make the ``Problem with IP header length'' error a bit more verbose 1999-09-06 18:20:26 +00:00
brian
029c9bc2f5 $FreeBSD$ -> __DATE__
This is probably more appropriate that $Date$ anyway
1999-09-06 18:11:50 +00:00
brian
1a77c3372e 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
e8a88abe94 $Date$ -> $FreeBSD$ 1999-09-06 07:36:44 +00:00
brian
dcb79a71e6 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
f51d44e622 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
efabb9ccb1 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
jkh
72d5ca324f 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
jkh
cb170f6ffd 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
adcdd2a153 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
945ebc8846 Aligh mbufs to sizeof(long), not 4 1999-08-26 06:37:53 +00:00
brian
41c2c2caf9 Fix some mdoc(7) style inconsistences
Submitted by: Alexey M. Zelkin" <phantom@cris.net>
1999-08-25 21:39:40 +00:00
brian
101f128474 Cosmetic: bring closer to RELENG_3 1999-08-23 23:13:59 +00:00
brian
185ca62b17 NOALIAS -> NONAT
Reminded by: jkh
1999-08-22 23:17:57 +00:00
brian
6ed835abf4 Allow authkey to be changed independently of the current phase. 1999-08-22 01:29:53 +00:00
brian
4f537e1f79 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
be5c500691 Mention `alias enable no'', not `alias enable off''. 1999-08-18 15:35:54 +00:00
brian
69ab84d0b3 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
56bc7b51a6 Set the close-on-exec flag for all unused descriptors when
exec()ing other programs.
1999-08-17 14:59:05 +00:00
brian
8b50508e93 If we receive an IPCP protocol reject, bring it down. 1999-08-10 08:42:20 +00:00
brian
d69ca183f0 Back out the last patch. I'm too tired to apply patches. 1999-08-09 23:49:59 +00:00
brian
b3409b1e8c 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
bef3aa58c7 Change printf formats %q[du] -> %ll[du] 1999-08-09 22:56:18 +00:00
brian
460ac15b25 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
b431c07559 Silence a warning about uninitialized variables. 1999-08-08 17:36:10 +00:00
brian
b1b2d4a0a7 Don't includei 4b support on the alpha 1999-08-08 17:35:35 +00:00
brian
864dcd0b2f 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
8229df47c3 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
c30dbdad40 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
75000c3883 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
054c42cb50 Reorganise ppp's usage to avoid some mandoc limitations.
Suggested by: wollman
1999-08-03 16:14:38 +00:00
brian
7b531b9dba Mention that ospf is a possible filter protocol. 1999-08-02 21:45:36 +00:00
brian
2f17ec0805 #ifdef IPPROTO_OSPFIGP before expecting it to be defined.
This unbreaks OpenBSD.
1999-08-02 15:29:19 +00:00
brian
5b5828498c Filter ospf and igmp separately.
Kind-of submitted by: phk
1999-08-02 11:53:16 +00:00
brian
5795239a2f Mention which rfc the DNS/NBNS IPCP extensions come from. 1999-07-29 14:37:26 +00:00
brian
61cc9f6d68 Don't return a garbage mbuf pointer after storing it
as an unresolved fragment.
1999-07-28 19:39:00 +00:00
brian
5245387bb3 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
c91d3bd70a 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
1ff3ce939b 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
6129b90dda Be a bit more consistent with variable names. 1999-07-27 00:30:32 +00:00
brian
dbc7eddfa5 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
85e61b7528 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
03e5d385bc Fix a typo
Submitted by:	Rich Wood <rich@chugaboom.net>
1999-07-17 10:33:57 +00:00
brian
22b3a1ff3e Don't declare `end' if we aren't compiling radius support. 1999-07-15 02:02:51 +00:00
brian
34098f71f9 Oops - add a missing cast. 1999-07-10 00:08:19 +00:00
brian
21e36fb5b3 Leap through one more hoop to avoid alignment problems. 1999-07-10 00:03:58 +00:00
brian
63f7bbda3e Don't bother read()ing if we ``expect'' nothing in our chat script. 1999-06-26 02:54:36 +00:00
brian
909ee378b7 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
f32906f485 Support `igmp' filters.
Mostly submitted by: Timo Geusch <freebsd@sleepycat.ukpeople.net>
1999-06-23 16:48:24 +00:00
brian
d252fb5178 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
db9a1d7a4e Don't use the ``next'' redial timer if we have no phone number at all. 1999-06-18 13:49:01 +00:00
brian
3fc0f0acb6 Come up with something useful when someone searches for
``dynamic IP''.
1999-06-14 10:12:41 +00:00
brian
ae6bae56ad Show the correct error if we fail to open a device. 1999-06-11 13:28:29 +00:00
brian
cacd46046a Describe why a ``magic'' enddisc is not always a good idea. 1999-06-11 11:27:18 +00:00
brian
0a48bba6aa Allow reserved substitution strings to be escaped by preceeding them
with a backslash.
1999-06-10 09:34:57 +00:00
brian
fa9febb9ac 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
49e3fb3677 Allow a remote IP and port range specification in the
``alias port'' command.
1999-06-10 00:17:27 +00:00
brian
56fab642ae Initialise `mp'. 1999-06-09 20:27:26 +00:00
brian
9c856b7692 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
fb0eee157d 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
b5ed987df0 Don't use static variables if we don't have to. 1999-06-08 20:12:06 +00:00
brian
9ba53ba0dd Don't drop the last character from lines in ppp.secret unless it's '\n'. 1999-06-08 20:11:53 +00:00
brian
a14b1bb88a 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
edabe1d262 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
b4fbb76a13 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
3af49a5061 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
0e558e446c Oops, quieten a compiler warning. 1999-06-02 23:06:21 +00:00
brian
769cb902d3 Mention physical and sync logging in the ``set log''
usage message.
1999-06-02 21:28:02 +00:00
brian
424e32a4e7 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
3b531265df 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
25a14e6be5 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
f062ad877c 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
4b1ce7da0d 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
effd132958 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
0e927447e3 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
e76602ae08 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
5f3f513bc6 Add some comments, optimise out a few strlen()s and
remove a few extraneous assignments.
1999-05-27 09:50:10 +00:00
brian
e6e17ede1c 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
d317a05c14 Move the code for tweaking interface flags into one function. 1999-05-27 08:42:17 +00:00
brian
c6862b32c0 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
c1cb414bf9 Don't warn about ``!'' lines being unindented commands in ppp.conf. 1999-05-24 09:04:35 +00:00
brian
69b4a4c606 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
0934553336 Mention ``show layers'' 1999-05-16 13:39:03 +00:00
brian
b609023898 Initialise ttydevice::Timer 1999-05-16 11:58:48 +00:00
phk
e5cb54b508 Be more non-crypto friendly at make release time. 1999-05-15 19:21:15 +00:00
brian
891aeb93bc Add ``show layers'' to see the protocol layering for a link. 1999-05-15 02:24:18 +00:00
brian
9cb58fe295 Handle LCP echo reqs properly again (broken with the
layering changes).
1999-05-14 09:36:06 +00:00
brian
c956814272 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
bc576fdb28 Initialise the struct device part of struct ttydevice. 1999-05-13 19:29:40 +00:00
brian
2f80c9ff33 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
50dbd19d74 Ignore repeated signals sent to the parent in background
mode.
1999-05-13 16:34:57 +00:00
brian
db91076768 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
827c4aedd6 Oops - hook the sync push diagnostics correctly. 1999-05-12 09:54:33 +00:00
brian
89ce3ea906 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
3ea9598814 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
00d71de444 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
ab7d88ae2d 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
4418c9ba63 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
743ae62c5f Mention ``show mp''.
Describe ACFComp correctly.
1999-05-02 08:52:50 +00:00
brian
7fc498ac36 Make ports 80 & 81 ``interactive''. 1999-05-01 11:31:29 +00:00
brian
9a2c03d6d7 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
42c76b892b Add support for NetBSD 1999-04-26 08:54:34 +00:00
brian
d1f60b18e9 #include <errno.h>, not <sys/errno.h> 1999-04-26 08:54:25 +00:00
brian
6c2a018d6d Spelling police 1999-04-23 13:45:50 +00:00
brian
6f81d00cd6 int -> size_t 1999-04-21 08:13:25 +00:00
brian
2f7b052d07 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
dcc03543e0 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
e52674f2ac 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
999ee7a1b0 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
93aa08a493 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
0ceecd2eef Remove forgotten variable. 1999-04-03 12:01:38 +00:00
brian
5db8066ee9 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
fa9cc0ebfb Drop PAP & CHAP packets if we're not in NETWORK or AUTHENTICATE
phase.
1999-04-01 11:05:23 +00:00
brian
368d30c3ca Avoid a few warnings on the alpha 1999-03-31 14:21:46 +00:00
brian
84a1abbf13 Oops - remove register keyword 1999-03-31 13:44:07 +00:00
brian
b0431d511c Another alignment bogon. 1999-03-31 13:33:43 +00:00
brian
2c5f507432 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
e9c44757c3 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
e0b990afc7 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
539d220871 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
1bf2486a41 Allow port ranges in ``alias port''. 1999-03-25 23:36:25 +00:00
brian
6354640a08 Undo possible damage done by the new TUNSIFMODE ioctl
in FreeBSD-current.
1999-03-25 11:37:51 +00:00
brian
042cb8af30 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
3d3f9f8b88 Replace hardcoded quoting with Sq or Dq. 1999-03-19 01:42:45 +00:00
brian
a9a1137a8b 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
76f3c63b39 Use ``Sx'' when xref'ing sections. 1999-03-18 21:53:56 +00:00
brian
984c995fd5 Remove all remaining [ and ] characters (and do things properly). 1999-03-18 21:50:52 +00:00
brian
1739eef5e6 Remove all hardcoded [...] syntax.
With help from: Daniel C. Sobral <dcs@newsguy.com>
1999-03-17 00:25:43 +00:00
brian
ba12f624a1 Mention changes to the default authentication behaviour. 1999-03-16 11:54:02 +00:00
brian
f7a7179f0f 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
e1bfa8246d 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
b63a2823ef 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
e412315216 Don't destroy the old server socket another ``set server''
call fails.
1999-03-08 22:35:19 +00:00
brian
e36037abff 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
ghelmer
70205dd33d 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
7ae299d980 Support PPTP via libalias (``alias pptp addr''). 1999-03-07 18:13:44 +00:00
brian
121ec0cce6 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
89abf4706b Correctly drop existing connections when reopening the diagnostic
socket.
1999-03-07 11:54:43 +00:00
brian
e8558b0707 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
2c3a4510e5 Use socketpair() instead of pipe()... pipe() doesn't return
two bi-directional descriptors under OpenBSD.
1999-03-07 01:41:27 +00:00
brian
2e90b5dd04 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
fe992c122e Extend the ``set redial'' command to allow incremental
redial timeouts.
1999-03-04 17:42:15 +00:00
brian
090ad2bf4c 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
275998efb0 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