summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/bundle.c
Commit message (Collapse)AuthorAgeFilesLines
* Include the correct file (stdarg.h) and use va_list rather than _BSD_VA_LIST_brian2002-08-271-0/+1
| | | | Suggested by: mike
* Remove whitespace at the end of lines.brian2002-06-151-5/+5
|
* Coerce pid_t to long rather than int for better portability.brian2002-05-271-4/+4
| | | | Suggested by: Theo de Raadt <deraadt@openbsd.org>
* Understand the Session-Timeout RADIUS attributebrian2002-05-071-2/+71
| | | | | | Store the Filter-Id attribute (we don't do anything with it yet) Submitted mostly by: andrew pavlov <and@kremenchug.net>
* Tweak a data type from char * to u_char *brian2002-05-041-2/+2
|
* When it's necessary to kldload tun(4), don't forget to re-try to openbrian2002-04-151-3/+4
| | | | | | tun0. Submitted by: qhwt@myrealbox.com
* Add a sprinkling of mp_Down() calls to ensure that we don't think thatbrian2002-03-301-1/+7
| | | | the multi-link NCP is up when it isn't.
* Merge the NETGRAPH branch into HEAD. tty devices now use netgraph's linebrian2002-03-301-17/+13
| | | | | | | | discipline to do the async escaping, but no other benefits are available yet. Change ``ifdef HAVE_DES'' to ``ifndef NODES'' for consistency. Make the Makefile a little more sane WRT RELEASE_CRUNCH.
* Add a ``log'' command for logging specific information.brian2001-11-031-1/+10
| | | | | | | | | | | | | | Add an ``UPTIME'' variable to indicate the bundle uptime. It's now possible to put something like this in ppp.linkdown for a server setup: MYADDR: log Session closing: User USER, address HISADDR, up UPTIME Fixed some memory leakage with commands that expand words. Made some functions static. Fixed a diagnostic bug (iface add .... SIOCDIFADDR)
* Hopefully improve control message passing over Unix domain sockets.dwmalone2001-10-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Allow the sending of more than one control message at a time over a unix domain socket. This should cover the PR 29499. 2) This requires that unp_{ex,in}ternalize and unp_scan understand mbufs with more than one control message at a time. 3) Internalize and externalize used to work on the mbuf in-place. This made life quite complicated and the code for sizeof(int) < sizeof(file *) could end up doing the wrong thing. The patch always create a new mbuf/cluster now. This resulted in the change of the prototype for the domain externalise function. 4) You can now send SCM_TIMESTAMP messages. 5) Always use CMSG_DATA(cm) to determine the start where the data in unp_{ex,in}ternalize. It was using ((struct cmsghdr *)cm + 1) in some places, which gives the wrong alignment on the alpha. (NetBSD made this fix some time ago). This results in an ABI change for discriptor passing and creds passing on the alpha. (Probably on the IA64 and Spare ports too). 6) Fix userland programs to use CMSG_* macros too. 7) Be more careful about freeing mbufs containing (file *)s. This is made possible by the prototype change of externalise. PR: 29499 MFC after: 6 weeks
* o Enable IFF_MULTICAST when first opening the tun device (and keep the flagbrian2001-08-211-9/+2
| | | | | | when we ioctl(TUNSIFINFO) under OpenBSD) o Don't bring the interface up immediately o Don't complain about unrecognised interface flags in ``show iface''.
* Back out the previous fix to deal with kernels that don't support IPv6,brian2001-08-181-1/+1
| | | | | | | | | | | | | | | and implement a far more subtle and correct fix. The reason behind the infinite loop was that ppp was trying to make up initial IPv6 numbers and wasn't giving up when it failed unexpectedly to assign the addresses it just fabricated to it's interface (thinking that the reason was because another interface was using the same address). It now attempts this up to 100 times before just failing and trying to muddle along (in reality, this should never happen more than a couple of times unless our random number generator doesn't work). Also, when IPv6 is not available, don't even try to assign the IPv6 interface address in the first place...
* Run correctly on a machine built without AF_INET6 supportbrian2001-08-181-1/+1
|
* Probe for the availability of AF_INET6 at startup. If it's notbrian2001-08-151-2/+5
| | | | | available, default ipv6cp to disabled and refuse to let the user enable it.
* o Add ipv6 support, abstracting most NCP addresses into opaquebrian2001-08-141-103/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | structures (well, they're treated as opaque). It's now possible to manage IPv6 interface addresses and routing table entries and to filter IPV6 traffic whether encapsulated or not. IPV6CP support is crude for now, and hasn't been tested against any other implementations. RADIUS and IPv6 are independent of eachother for now. ppp.linkup/ppp.linkdown aren't currently used by IPV6CP o Understand all protocols(5) in filter rules rather than only a select few. o Allow a mask specification for the ``delete'' command. It's now possible to specifically delete one of two conflicting routes. o When creating and deleting proxy arp entries, do it for all IPv4 interface addresses rather than doing it just for the ``current'' peer address. o When iface-alias isn't in effect, don't blow away manually (via ``iface add'') added interface addresses. o When listening on a tcp server (diagnostic) socket, bind so that a tcp46 socket is created -- allowing both IPv4 and IPv6 connections. o When displaying ICMP traffic, don't display the icmp type twice. When display traffic, display at least some information about unrecognised traffic. o Bump version Inspired after filtering work by: Makoto MATSUSHITA <matusita@jp.FreeBSD.org>
* Reduce the interface MTU by 2 when MPPE has been successfully negotiated.brian2001-07-031-5/+21
| | | | | | This is necessary because MPPE will combine the protocol id with the payload received on the tun interface, encrypt it, then prepend its own protocol id, effectively increasing the payload by two bytes.
* Handle hardware-imposed MTU/MRU limitations. PPPoE will no longerbrian2001-06-181-14/+7
| | | | | | | | | | | | allow MRU/MTU negotiations to exceed 1492. Add an optional ``max'' specifier to ``set m[rt]u'', ie. set mtu max 1480 Bump the ppp version number. Sponsored by: Monzoon Networks AG and FreeBSD Services Limited
* When we change the interface MTU, run through the routing table and tweakbrian2001-04-051-122/+4
| | | | all route MTUs too.
* Bring the PPPoE interface UP if requiredbrian2001-03-281-2/+2
| | | | Suggested by: archie
* Deal with ENOENT properly on non-devfs machinesbrian2001-03-121-4/+3
| | | | Broken in revision 1.109
* MAXPATHLEN -> PATH_MAXbrian2001-03-081-2/+2
| | | | | | Don't assume MAXHOSTNAMELEN includes the NUL Correct a diagnostic Use "localhost" in our prompt instead of ""
* MPPE_MasterKeyValid is only there if HAVE_DES is defined.brian2001-02-041-0/+2
|
* Make the MPPE MasterKey Invalid messages a bit clearer (it nowbrian2001-02-041-1/+3
| | | | | | complains that you can't do MPPE without CHAP81). Reset MasterKeyValid to zero when we hit phase DEAD.
* Untangle some cunfusion between the CLOSE_STAYDOWN, CLOSE_LCP andbrian2001-02-041-1/+1
| | | | | | | | CLOSE_NORMAL meanings. CLOSE_NORMAL doesn't change the currently required state, the others do. This should stop ppp from entering DATALINK_READY when LCP shutdown doesn't end up happening cleanly. Bump our version number to reflect this change.
* Try to kldload if_tun if we get ENOENT from opening /dev/tunN -brian2001-02-021-1/+1
| | | | | | | not just if we get ENXIO. This makes ppp work with DEVFS when if_tun isn't built into the kernel (without needing to manually kldload it).
* Only remove socket files with ``set server open''.brian2001-01-291-5/+6
| | | | | | | Only show the mask in ``show bundle'' when it's been specified. Complain about unexpected arguments after ``set server {none,open,closed}'' Log re-open failures as warnings rather than phase messages. Fix some markup for the ``set server'' man page description.
* Allow ``set server closed'' to close the diagnostic socket.brian2001-01-261-18/+30
| | | | | | | | | Allow ``set server open'' to re-open the diagnostic socket. Handle SIGUSR1 by re-opening the diagnostic socket When receiving SIGUSR2 (and in ``set server none''), don't forget the socket details so that ``set server open'' and SIGUSR1 open it again. Don't create the diagnostic socket as uid 0 ! It's far to dangerous.
* Add ``enable/disable tcpmssfixup'', defaulting to enabled.brian2000-11-281-12/+16
| | | | | Suggested by: julian Hijacked from: ru (ports/net/tcpmssd)
* Support radius accounting, and add a packet count to throughputbrian2000-08-281-0/+1
| | | | | | | | | statistics as a side effect. Submitted by: Marcin Cieslak <saper@system.pl> with some tweaks to RAD_ACCT_SESSION_ID and RAD_ACCT_MULTI_SESSION_ID generation by me.
* Make -DNOSUID (or -DPPP_NOSUID) possible to build ppp without SUIDbrian2000-08-181-0/+5
| | | | capabilities.
* setproctitle() doesn't need to be called with root privs, so movebrian2000-08-161-2/+1
| | | | it from id.c into defs.c
* Maintain input and output throughput averages and choose the highestbrian2000-08-151-6/+9
| | | | | | | | | | | | | | of the two when calculating the MP throughput average for the ``set autoload'' implementation. This makes more sense as all links I know of are full-duplex. This also means that people may need to adjust their autoload settings as 100% bandwidth is now the theoretical maximum rather than 200% (but of course, halfing the current settings is probably not the correct answer either!). This involves a ppp version bump as we need to pass an extra throughput array through the MP local domain socket.
* Calculate the average link throughput using a counter based on thebrian2000-08-151-4/+4
| | | | | | | | cumulative total of all active links rather than basing it on the total of PROTO_MP traffic. This fixes a problem whereby Cisco routers send PROTO_IP packets only when there's only one link (hmm, what a good idea!).
* Allow a ``timeout secs'' filter option to let specific packet typesbrian2000-07-111-14/+23
| | | | | | | | | | | | effect the idle timer in different ways. Submitted by: Stefan Esser <se@freebsd.org> With adjustments by me to document the option in the man page and to give the same semantics for outgoing traffic as incoming. I made the style more consistent in ip.c - this should really have been done as a separate commit.
* Fix -auto breakage introduced with the last commit.brian2000-07-111-1/+1
|
* o Log the (payload/size) of all packet types, not just TCP packetsbrian2000-07-071-11/+14
| | | | | | | | | | | | | | | | | | | o If the new ``filter-decapsulation'' is enabled, delve into UDP packets that contain 0xff 0x03 as the first two bytes, and if we recognise it as PROTO_IP, decapsulate it for the purpose of filter checking. If we recognise it as PROTO_<anything else> mention this for logging purposes only. This change is aimed at people running PPPoUDP where the UDP traffic is being sent over another PPP link. It's desireable to have the top level link connected all the time, but to have the bottom level link capable of decapsulating the traffic and comparing the payload against the filters, thus allowing ``set filter dial ...'' to work in tunnelled environments. The caveat here is that the top ppp cannot employ any compression layers without making the data unreadable for the bottom ppp. ``disable deflate pred1 vj'' and ``deny deflate pred1 vj'' is suggested.
* Fix a printf-style arg cast (again)brian2000-06-231-1/+2
|
* Fix a printf-style format errorbrian2000-06-181-1/+1
|
* Add ``set ifqueue'' to control the size of the outgoing packetbrian2000-06-111-2/+7
| | | | | | | queue. Doing ``set ifqueue 0'' and ``set urgent none'' will allow full use of luigi's WF2Q code. Requested by: luigi
* Use mp_CheckAutoloadTimer() rather than mp_StopAutoloadTimer()brian2000-05-311-2/+2
| | | | | | | when opening or closing an auto link due to the autoload setting. Spotted by: David Hedley <david@inty.co.uk>
* When we do a ``dial'' or ``open'' from DATALINK_READY, go tobrian2000-05-261-5/+4
| | | | | | | | | | DATALINK_CARRIER and turn off scripting. This should fix instances where ``term'' is used followed by ~. and then ``dial''/``open'' (it currently just sits there looking at you). Reported by: Tim Vanderhoek <vanderh@ecf.utoronto.ca>
* When running ppp -background, show comfort messages showingbrian2000-04-071-10/+18
| | | | | | | | when we're redialing/reconnecting. While we're here, log redial, reconnect and phone number announcements to LogCHAT, and reduce some other logging to LogDEBUG.
* I didn't get this right the last time....brian2000-04-061-13/+20
| | | | | | | | | | | | | When an NCP reaches TLF, *ONLY* datalink_Close() links that are in DATALINK_OPEN. When the last link reaches TLD, DOWN all NCPs (as we used to in the links TLF (which was the wrong place anyway)), as the NCPs aren't now going to datalink_Close() us unexpectedly, we get to continue doing what we were told to do in the first place. The result: When we lose a link, the IPCP layer goes down and we actually call the stuff in ppp.linkdown !
* Correct the parent notification diagnostic emitted from the childbrian2000-03-221-1/+2
| | | | process in -background mode (it should report failure if appropriate).
* If a links LCP FSM has reached TLF and it's the last link,brian2000-03-221-12/+5
| | | | | | | | | | | | | don't bother to re-initialise the NCPs. Instead wait for bundle_LinkClosed() to be called - IFF it actually is called. By initialising the NCPs at this point, ppp was recursing back into the fsm_Down() routing for the link, and losing track of the reason that the link was being brought down. The end result was that ``set reconnect'' would never do anything. Patiently pointed out by: ru
* Add the ``resolv'' command for telling ppp how to deal with resolv.conf.brian2000-03-141-4/+13
| | | | | You can now ``resolv restore'' in ppp.linkdown ! Add DNS0 and DNS1 macros.
* Fix some printf-style argument bugsbrian2000-03-141-7/+9
|
* Correct some typos introduced in the descriptor -> fdescriptor change.brian2000-03-141-8/+8
|
* To avoid namespace polution in NetBSD:brian2000-03-141-12/+12
| | | | ``struct descriptor'' -> ``struct fdescriptor''
* Handle the availability of TUNSIFHEAD. If it's there, use it.brian2000-01-231-13/+52
| | | | | For the moment this is just overhead, but it'll be used for INET6 support later.
OpenPOWER on IntegriCloud