Commit Graph

1031 Commits

Author SHA1 Message Date
brian
f578b83396 Add some diagnostics to prove that incoming IP fragments are
being dealt with correctly.
2000-03-19 12:37:27 +00:00
brian
91b66530e9 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
a242c9a683 Increase bit fields to allow for new values 2000-03-14 20:11:45 +00:00
brian
420917259f 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
e8564a1fa4 Understand -DNOINET6 2000-03-14 19:33:13 +00:00
brian
f78172a3f5 Understand environment variables in commands
Submitted by: Mark Knight <markk@knigma.org>
2000-03-14 01:47:31 +00:00
brian
d3adbcad04 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
85512efa64 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
d915279bc0 Fix some printf-style argument bugs 2000-03-14 01:47:19 +00:00
brian
75fdce32f8 Fix some typos
Obtained from: OpenBSD
2000-03-14 01:47:13 +00:00
brian
cb839970d4 Adjust whitespace 2000-03-14 01:47:11 +00:00
brian
1a3b395845 Don't include netinet6/in6.h directly. 2000-03-14 01:47:09 +00:00
brian
249ed8d6eb Correct some typos introduced in the descriptor -> fdescriptor change. 2000-03-14 01:47:07 +00:00
brian
428154656b 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
b7053a7740 Correct UN_SIZE definition
Submitted by: Ben Smithurst <ben@scientia.demon.co.uk>
2000-03-14 01:46:58 +00:00
brian
1670500994 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
30f1fc02c6 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
4f997528e5 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
59a92c2342 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
7de9fa217c 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
40c99babf2 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
593fa35a41 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
edc4275c39 To avoid namespace polution in NetBSD:
``struct descriptor'' -> ``struct fdescriptor''
2000-03-14 01:46:09 +00:00
kris
17ded40ab0 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
ff6d9a44ba Buildworld fixes for NO_OPENSSH and NO_OPENSSL
Approved by:	jkh
2000-03-09 06:29:05 +00:00
sheldonh
c0e8952a50 Remove more single-space hard sentence breaks. 2000-03-02 14:54:02 +00:00
markm
fa09a31141 Update DISTRIBUTION for new crypto world order 2000-02-29 11:44:18 +00:00
markm
e8ccee3398 Use libcrypto instead of libdes. 2000-02-24 21:10:28 +00:00
ru
6ef70f5717 Unbroke the reference to libalias(3). 2000-02-05 15:25:15 +00:00
brian
fbfc1ea7b8 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
a8c2ce5f53 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
40bca11636 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
b6909567d5 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
a21a8432d2 Use TUNSIFPID when we change our PID (if it exists). 2000-01-21 00:33:27 +00:00
brian
5c9e39b6b3 Use AUTHLEN for the length of authname 2000-01-17 12:27:29 +00:00
brian
ece4520852 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
d9a3acdec8 include stdlib.h (setproctitle() is prototyped there in OpenBSD) 2000-01-07 03:23:38 +00:00
brian
9a7c321062 Call serial devices `cuaXX'' instead of `cuaaX'' (in line
with OpenBSD conventions).
2000-01-07 03:11:56 +00:00
brian
22986a9f97 .Bl -tag requires -width too
Obtained from: OpenBSD
2000-01-07 03:11:42 +00:00
brian
aebf883bbe Remove an unused #define 2000-01-07 03:11:31 +00:00
brian
66bb2bc917 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
a7351f7749 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
b23820d596 Add a few missing #includes 1999-12-30 03:40:29 +00:00
brian
f190d11c7d Correct usages of getuid() and geteuid()
Pointed out by: billf
1999-12-30 03:36:11 +00:00
brian
31e86e82d5 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
d4de4f097d 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
3c873744b6 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
0984e63638 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
411a73ca11 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
411436c45f 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
06587288d7 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
679bada5e7 Fix my '#'-at-end-of-lines change, spammed by a subsequent commit. 1999-12-20 20:47:58 +00:00
brian
654897b4bf Use getpwuid()->pw_dir instead of $HOME when expanding ``~''. 1999-12-20 20:30:47 +00:00
brian
2b12ad54f0 Use getpwuid() instead of getlogin() in ``allow users''. 1999-12-20 20:30:40 +00:00
brian
5bbfb9a312 Add missing linefeed. 1999-12-20 20:30:35 +00:00
brian
7a62d8a465 Cosmetic: clean up some parenthesis confusion 1999-12-20 20:30:30 +00:00
brian
d574ab6d26 Handle comments at the end of lines. 1999-12-20 20:30:25 +00:00
brian
3e6b8e10f7 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
5579308326 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
919d0f538f Cosmetic: Make struct mbuf more like kernel mbufs. 1999-12-20 20:29:47 +00:00
brian
17689cb175 Learn to do pointer arithmatic (doh!) 1999-12-18 02:31:36 +00:00
brian
920758ddf3 Handle PPPoPTY correctly. 1999-12-13 18:45:21 +00:00
brian
ee3f468587 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
9491d4a14b 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
90f2d067c1 depricated -> deprecated + mention the -alias flag status in README.changes 1999-11-29 18:53:43 +00:00
brian
c0de590a5c 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
ddd684a1a2 Make -foreground a proper option (allowing ``allow mode foreground'',
``set mode foreground'' etc.
1999-11-28 15:50:08 +00:00
brian
428643dd44 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
3c65bdc9a6 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
a5fa2f99ed 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
2aeda99cbb Don't setuid() 'till we've called ID0setproctitle() 1999-11-23 00:14:50 +00:00
brian
2c7a1f86db Call MkSockNode() as uid 0
Forgotten by: julian
1999-11-21 23:27:23 +00:00
brian
a853a364d8 Don't compile NETGRAPH out of ppp for the release crunch 1999-11-20 10:55:27 +00:00
brian
a1c1bf8f7c 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
b484490afe Fix ``set proctitle'' by using setproctitle(). 1999-11-17 21:12:35 +00:00
brian
eb7a7a45a7 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
f6ac69f153 Use modfind() to check if a kld is already loaded.
Submitted mostly by: green
1999-11-16 21:57:34 +00:00
brian
5151d97759 Don't insist on 4 digit umasks in ``set server''.
Pointed out by: joerg
1999-11-13 16:18:40 +00:00
brian
7be13127ce Make the meaning of the provider part of the PPPoE device spec clearer. 1999-11-13 16:18:27 +00:00
brian
dc3ab5d742 Oops, netgraph.o -> ether.o for the RELEASE build. 1999-11-11 02:25:17 +00:00
brian
c5d2ca82c6 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
e1e62f8cd4 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
64d12e8b5b 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
a519ec330f Be a bit smarter when identifying a netgraph node
(don't dereference NULL).
1999-11-09 19:05:48 +00:00
brian
50dd1d29fc 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
35e0fd3284 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
b9908f0754 Don't zero-pad netgraph node ids
Recommended by: julian
1999-11-07 09:03:45 +00:00
brian
8bac1154cf Support PPPoE
Help (lots) from: julian, archie
Facilities from: ahebert@pubnix.net
1999-11-06 22:50:59 +00:00
brian
b3ddae2734 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
3c23268eff Don't (unnecessarily) parse wtmp, force ID0logout() to DTRT instead. 1999-10-25 13:31:42 +00:00
brian
aff584d577 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
a960365ba9 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
44b4c57a07 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
492cd0a5e5 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
366399cf8b Correct a few diagnostics 1999-10-16 13:28:04 +00:00
brian
5a964a75d5 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
420eed68cc 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
3b5db3e08a 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
a7eff426e3 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
79847cf7ae 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
700dab7295 Revert the 1.44 -> 1.45 change. It doesn't work as expected. 1999-10-08 16:09:15 +00:00
brian
9348e209d6 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
0ffffae973 Mention the received/expected magic for dodgy ECHO LQRs. 1999-10-06 23:22:54 +00:00
brian
76903a0107 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
10fffd82cc Support GRE packets
Submitted by: Harry Starr <starr@gccs.com.au>
1999-09-30 07:23:13 +00:00
brian
f2a9faf145 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
3ce963a250 Typo
Submitted by:	Alex Nash <nash@mcs.net>
1999-09-24 23:57:22 +00:00
brian
434117ce04 Allow ``make -DNOKLDLOAD'' 1999-09-22 00:44:45 +00:00
brian
fbeea0349e 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
de40f95a74 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
ad686a633a 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
34985ba96d 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
db76d7198d 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
80c2fd2761 NetBSD requires net/if.h for the IFF_* defines (as well as OpenBSD) ! 1999-09-20 07:18:50 +00:00
brian
a40cc1a5a0 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
1489ec63d4 Cosmetic:
alias_cmd -> nat_cmd after a repo-copy
1999-09-08 07:34:52 +00:00
brian
71a051773f We don't need a queue for *CP data - these are IP-only queues. 1999-09-07 14:34:55 +00:00
brian
4143661610 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
8bf6b7951a Make the ``Problem with IP header length'' error a bit more verbose 1999-09-06 18:20:26 +00:00
brian
cd6649d6ad $FreeBSD$ -> __DATE__
This is probably more appropriate that $Date$ anyway
1999-09-06 18:11:50 +00:00
brian
83cd9fc38b 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
0fbc009ad8 $Date$ -> $FreeBSD$ 1999-09-06 07:36:44 +00:00
brian
e896a92b45 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
0c458429a9 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
b6784c4210 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
jkh
4db2bcd2e6 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
1afd67916a 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
607e3e0b39 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
2c0a6853c6 Aligh mbufs to sizeof(long), not 4 1999-08-26 06:37:53 +00:00
brian
d58e537c99 Fix some mdoc(7) style inconsistences
Submitted by: Alexey M. Zelkin" <phantom@cris.net>
1999-08-25 21:39:40 +00:00
brian
51680ee425 Cosmetic: bring closer to RELENG_3 1999-08-23 23:13:59 +00:00
brian
50e567ced1 NOALIAS -> NONAT
Reminded by: jkh
1999-08-22 23:17:57 +00:00
brian
c21515c1a9 Allow authkey to be changed independently of the current phase. 1999-08-22 01:29:53 +00:00
brian
9f2b7222c3 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
fb6c3d09c1 Mention `alias enable no'', not `alias enable off''. 1999-08-18 15:35:54 +00:00
brian
0652c58a9e 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
63105bcb67 Set the close-on-exec flag for all unused descriptors when
exec()ing other programs.
1999-08-17 14:59:05 +00:00
brian
9be39f69db If we receive an IPCP protocol reject, bring it down. 1999-08-10 08:42:20 +00:00
brian
9fa72e2948 Back out the last patch. I'm too tired to apply patches. 1999-08-09 23:49:59 +00:00
brian
44ba1f8de6 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
2038236d78 Change printf formats %q[du] -> %ll[du] 1999-08-09 22:56:18 +00:00
brian
a3201b63a4 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
a714c97c5e Silence a warning about uninitialized variables. 1999-08-08 17:36:10 +00:00
brian
7787776bac Don't includei 4b support on the alpha 1999-08-08 17:35:35 +00:00
brian
1d136c5cea 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
3c5205f426 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
06fc461492 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
8040e68857 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
068d2e8f66 Reorganise ppp's usage to avoid some mandoc limitations.
Suggested by: wollman
1999-08-03 16:14:38 +00:00
brian
cb03a0a505 Mention that ospf is a possible filter protocol. 1999-08-02 21:45:36 +00:00
brian
b1dc3c2055 #ifdef IPPROTO_OSPFIGP before expecting it to be defined.
This unbreaks OpenBSD.
1999-08-02 15:29:19 +00:00
brian
2bb1304026 Filter ospf and igmp separately.
Kind-of submitted by: phk
1999-08-02 11:53:16 +00:00
brian
63e5938bc5 Mention which rfc the DNS/NBNS IPCP extensions come from. 1999-07-29 14:37:26 +00:00
brian
8190168ff5 Don't return a garbage mbuf pointer after storing it
as an unresolved fragment.
1999-07-28 19:39:00 +00:00
brian
3c3730e544 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
b1e2568a74 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
caf44157f7 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
ff795a3c8a Be a bit more consistent with variable names. 1999-07-27 00:30:32 +00:00
brian
39e8ada562 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
57c8debd5f 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
ac3ceda750 Fix a typo
Submitted by:	Rich Wood <rich@chugaboom.net>
1999-07-17 10:33:57 +00:00
brian
0a88060ec0 Don't declare `end' if we aren't compiling radius support. 1999-07-15 02:02:51 +00:00
brian
d857dcc720 Oops - add a missing cast. 1999-07-10 00:08:19 +00:00
brian
9c4ccb7f5f Leap through one more hoop to avoid alignment problems. 1999-07-10 00:03:58 +00:00
brian
f285ede018 Don't bother read()ing if we ``expect'' nothing in our chat script. 1999-06-26 02:54:36 +00:00
brian
2b58d25492 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
cff11489a9 Support `igmp' filters.
Mostly submitted by: Timo Geusch <freebsd@sleepycat.ukpeople.net>
1999-06-23 16:48:24 +00:00
brian
03f37b2162 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
e2797ccaca Don't use the ``next'' redial timer if we have no phone number at all. 1999-06-18 13:49:01 +00:00
brian
0f1321c494 Come up with something useful when someone searches for
``dynamic IP''.
1999-06-14 10:12:41 +00:00
brian
42f2a0b71d Show the correct error if we fail to open a device. 1999-06-11 13:28:29 +00:00
brian
45e0115c27 Describe why a ``magic'' enddisc is not always a good idea. 1999-06-11 11:27:18 +00:00
brian
9a0bce272e Allow reserved substitution strings to be escaped by preceeding them
with a backslash.
1999-06-10 09:34:57 +00:00
brian
2aa45a21d0 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
e38303d43c Allow a remote IP and port range specification in the
``alias port'' command.
1999-06-10 00:17:27 +00:00
brian
a71c6ca380 Initialise `mp'. 1999-06-09 20:27:26 +00:00
brian
472a277d26 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
ecf825269a 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
ed2d80f59c Don't use static variables if we don't have to. 1999-06-08 20:12:06 +00:00
brian
a557d51984 Don't drop the last character from lines in ppp.secret unless it's '\n'. 1999-06-08 20:11:53 +00:00
brian
30bfd76142 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
a7f994e40c 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
5425bb01c0 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
efbb71c511 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
a3ba58f533 Oops, quieten a compiler warning. 1999-06-02 23:06:21 +00:00
brian
42fe7474a9 Mention physical and sync logging in the ``set log''
usage message.
1999-06-02 21:28:02 +00:00
brian
bbbd0aef90 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
2401bce80b 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
89b86dc6ea 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
ed0d10bcdc 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
25a2440c6f 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
be201b7693 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
44647b0f4d 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
9ef4827356 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
029592c490 Add some comments, optimise out a few strlen()s and
remove a few extraneous assignments.
1999-05-27 09:50:10 +00:00
brian
8fc2c43f16 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
dd813bf3cc Move the code for tweaking interface flags into one function. 1999-05-27 08:42:17 +00:00
brian
8d73072137 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
6e3dffd5ac Don't warn about ``!'' lines being unindented commands in ppp.conf. 1999-05-24 09:04:35 +00:00
brian
9f8ec2fa75 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