aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/ipcp.c
Commit message (Collapse)AuthorAgeFilesLines
* Conditionally add the interface name and address if availableBjoern A. Zeeb2009-04-201-1/+1
| | | | | | | | | | | | | so that a ppp running in `receiver' (server) mode can properly update routes, for example to update the MTU. Submitted by: loos.br gmail.com (Luiz Otavio O Souza) PR: bin/130159 PR: kern/125079, kern/122068, bin/126892 MFC after: 3 days Notes: svn path=/head/; revision=191316
* Update to the "new" libalias API (and thus fix world breakage).Paolo Pisati2008-03-121-1/+3
| | | | Notes: svn path=/head/; revision=177100
* Add a radius_Flush() function that waits for the response (or timeout) toBrian Somers2005-01-271-0/+1
| | | | | | | | | | | | | | | | | any pending RADIUS transaction. Use this before sending RAD_STOP RADIUS messages so that we definitely ``stop'' the session. It was discovered that sometimes when the link timed out, we got lucky enough to have an un-ACK'd RADIUS accounting transaction in progress, resulting in the RAD_STOP message failing to send. Original report found on: A russion news group Text translated by: glebius Tested by: Alexey Popov llp at iteranet dot com MFC after: 7 days Notes: svn path=/head/; revision=140905
* Integrate some OpenBSD alignment fixes. This hopefully also fixes PR 38058...Brian Somers2005-01-101-20/+28
| | | | | | | Obtained from: Brad <brad@comstyle.com> Notes: svn path=/head/; revision=139973
* Make ppp WARNS=5 cleanBrian Somers2004-09-051-29/+19
| | | | Notes: svn path=/head/; revision=134789
* Support a ``set rad_alive N'' command to enable periodic RADIUS accountingBrian Somers2004-07-171-3/+5
| | | | | | | | | | | | | | information being sent to the RADIUS server. Logging of RADIUS accounting information moves to a ``set log [+-]radius'' level, along with the RADIUS alive info, and the version number is bumped to 3.2 to reflect this. Mostly submitted by: alx@sm.ukrtel.net (back in January) MFC after: 3 weeks Notes: svn path=/head/; revision=132273
* Do RADIUS accounting on IPV6CP.Hajimu UMEMOTO2003-06-191-3/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=116588
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-011-1/+1
| | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533
* If the peer gives us 0.0.0.0 as his IP number, NAK it rather than acceptingBrian Somers2002-09-231-1/+2
| | | | | | | | | | | | | | it as being in range. set ifaddr 1.2.3.4/0 5.6.7.8/0 no longer allows 0.0.0.0 as a valid IP. Reported/tested by: Bohdan Horst <nexus@hoth.amu.edu.pl> MFC after: 3 days Notes: svn path=/head/; revision=103875
* Include the correct file (stdarg.h) and use va_list rather than _BSD_VA_LIST_Brian Somers2002-08-271-0/+1
| | | | | | | Suggested by: mike Notes: svn path=/head/; revision=102500
* Remove whitespace at the end of lines.Brian Somers2002-06-151-2/+2
| | | | Notes: svn path=/head/; revision=98243
* If a RAD_FILTER_ID is supplied by the RADIUS server, treat it as anBrian Somers2002-06-121-0/+8
| | | | | | | | | additional label from ppp.linkup & ppp.linkdown to load. Suggested and mostly submitted by: andrew pavlov <and@kremenchug.net> Notes: svn path=/head/; revision=98151
* Make the way FSM options are processed easier to read by using structuresBrian Somers2002-04-161-159/+142
| | | | | | | | | | | | | | instead of u_char *. The changes are cosmetic except: RecvConfigAck() now displays the options that are being ACK'd Huge (bogus) options sent from the peer won't cause an infinite loop SendIdent and ReceiveIdent are displayed consistenlty with other FSM data LCP AUTHPROTO options that aren't understood are NAK'd, not REJ'd Notes: svn path=/head/; revision=94894
* socket()s first argument should be a protocol family rather than anBrian Somers2002-01-161-1/+1
| | | | | | | address family. Notes: svn path=/head/; revision=89422
* Specify the gateway address when updating the MTU and send/recv pipeBrian Somers2001-08-161-3/+10
| | | | | | | | | | | | | sizes on a route. IMHO this shouldn't be necessary (the destination & mask/prefixlen should be enough), but without it, the default route update under OpenBSD will fail. Thanks to: Russell T Hunt <alaric@MIT.EDU> Notes: svn path=/head/; revision=81739
* Add a missing newlineBrian Somers2001-08-151-1/+1
| | | | Notes: svn path=/head/; revision=81693
* o Add ipv6 support, abstracting most NCP addresses into opaqueBrian Somers2001-08-141-324/+275
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=81634
* If the peer sends a REQ without the IPADDR option, only reject itBrian Somers2001-07-281-6/+15
| | | | | | | | | | | | | once. If they repeat the request (again without the IPADDR option) ACK it. I've had reports that some ppp implementations will not assign themselves an IP number. This should negotiate with such things. MFC after: 3 days Notes: svn path=/head/; revision=80476
* Convert IIJ copyrights to BSD copyrights.Brian Somers2001-06-131-20/+25
| | | | | | | Approved by: Toshiharu OHNO <tohno@sirius.ocn.ne.jp> Notes: svn path=/head/; revision=78189
* If we don't receive a TY_IPADDR option as part of a configure request, NAKBrian Somers2001-05-221-62/+80
| | | | | | | as if we received one with 0.0.0.0 as the argument. Notes: svn path=/head/; revision=76986
* Bring the interface IFF_UP from ipcp_InterfaceUp() (called from IPCP'sBrian Somers2001-05-111-0/+7
| | | | | | | | | | | TLU event handler). This used to be done as a side effect of SIOCAIFADDR'ing the interface, but now that duplicate SIOCAIFADDRs are optimised out, we can't depend on that behaviour. Notes: svn path=/head/; revision=76492
* When we change the interface MTU, run through the routing table and tweakBrian Somers2001-04-051-2/+2
| | | | | | | all route MTUs too. Notes: svn path=/head/; revision=75212
* MAXHOSTNAME includes space for a NULBrian Somers2001-03-091-1/+1
| | | | Notes: svn path=/head/; revision=74049
* MAXPATHLEN -> PATH_MAXBrian Somers2001-03-081-1/+1
| | | | | | | | | Don't assume MAXHOSTNAMELEN includes the NUL Correct a diagnostic Use "localhost" in our prompt instead of "" Notes: svn path=/head/; revision=74001
* Handle SECDNS being rejected when PRIDNS is notBrian Somers2001-01-221-2/+5
| | | | | | | | Submitted by: OGAWA Takaya <t-ogawa@triaez.kaisei.org> PR: 24518 Notes: svn path=/head/; revision=71356
* Support radius accounting, and add a packet count to throughputBrian Somers2000-08-281-0/+11
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=65178
* Don't delete sticky routes when unconfiguring the interface.Brian Somers2000-08-141-2/+0
| | | | | | | Deleting all routes that match the interface is sufficient. Notes: svn path=/head/; revision=64637
* Support link identification from rfc1570Brian Somers2000-07-191-1/+1
| | | | | | | Two new commands are available; ``ident'' and ``sendident''. Notes: svn path=/head/; revision=63484
* Allow ``set urgent none'' to disable all urgent ports and IPTOS_LOWDELAYBrian Somers2000-06-081-1/+3
| | | | | | | | | prioritisation. Requested by: luigi Notes: svn path=/head/; revision=61430
* Fix a topy (if (expr); command;)Brian Somers2000-05-251-1/+1
| | | | | | | Submitted by: Renaud Waldura <renaud@guppy.evolunet.com> Notes: svn path=/head/; revision=60922
* Don't attempt to fputs(NULL, fp) when ``enable dns'' is given andBrian Somers2000-05-241-2/+3
| | | | | | | | there's no resolv.conf. Use a umask of 022 when creating resolv.conf, not 0644 ! Notes: svn path=/head/; revision=60839
* Add the ``resolv'' command for telling ppp how to deal with resolv.conf.Brian Somers2000-03-141-117/+220
| | | | | | | | You can now ``resolv restore'' in ppp.linkdown ! Add DNS0 and DNS1 macros. Notes: svn path=/head/; revision=58044
* Fix some printf-style argument bugsBrian Somers2000-03-141-1/+2
| | | | Notes: svn path=/head/; revision=58042
* Introduce LOCALNAT and LOCALRAD defines so that the sources can stayBrian Somers2000-03-141-3/+4
| | | | | | | | exactly the same in FreeBSD & OpenBSD despite libalias and libradius being local to the ppp sources under OpenBSD. Notes: svn path=/head/; revision=58037
* When ppp can't identify the relevant name, don't use "???", useBrian Somers2000-03-141-24/+23
| | | | | | | <nnn> or <0xxxx> instead. Notes: svn path=/head/; revision=58034
* Add a bunch of `const's and fix a typo.Brian Somers1999-12-271-3/+3
| | | | | | | Submitted by: Rich Neswold <rneswold@MCS.Net> Notes: svn path=/head/; revision=55146
* Cosmetic: Make struct mbuf more like kernel mbufs.Brian Somers1999-12-201-2/+2
| | | | Notes: svn path=/head/; revision=54912
* Back out the bogus #ifdef __NetBSD__ #include <signal.h> lines.Brian Somers1999-09-211-3/+0
| | | | | | | | | | The original report was due to a mis-installation of the NetBS header files :-/ Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp> Notes: svn path=/head/; revision=51517
* NetBSD has moved ``extern int errno;'' to signal.h :-/Brian Somers1999-09-201-0/+3
| | | | | | | Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp> Notes: svn path=/head/; revision=51449
* Introduce a forth IP packet queue. Urgent packets withBrian Somers1999-09-071-43/+68
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=51048
* o Split the two IPCP queues into three - one for FSM dataBrian Somers1999-09-041-1/+112
| | | | | | | | | | | | | | | (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''. Notes: svn path=/head/; revision=50867
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50479
* o Add the -foreground switch. This switch behaves like -background exceptBrian Somers1999-08-191-4/+4
| | | | | | | | | | | | 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''. Notes: svn path=/head/; revision=50059
* o Obsolete the undocumented ``set weight'' command.Brian Somers1999-08-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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). Notes: svn path=/head/; revision=49434
* Don't use static variables if we don't have to.Brian Somers1999-06-081-3/+2
| | | | Notes: svn path=/head/; revision=47844
* Don't IPCP TLD if we're already doing it. This preventsBrian Somers1999-06-081-19/+23
| | | | | | | | recursion by doing something like ``down'' or ``quit all'' in ppp.linkdown. Notes: svn path=/head/; revision=47835
* o Alter the mbuf type as it's processed by different layers.Brian Somers1999-06-021-3/+5
| | | | | | | | | | | 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(). Notes: svn path=/head/; revision=47695
* Remember if MYADDR or HISADDR is used in a filter add tweak allBrian Somers1999-05-311-3/+6
| | | | | | | filters any time either value changes. Notes: svn path=/head/; revision=47648
* Deal with the fact that as we now mbuf_Read the fsmBrian Somers1999-05-091-2/+2
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=46828
* o Redesign the layering mechanism and make the aliasing code part ofBrian Somers1999-05-081-19/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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''. Notes: svn path=/head/; revision=46686