summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/route.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't delete sticky routes when unconfiguring the interface.brian2000-08-141-12/+0
| | | | Deleting all routes that match the interface is sufficient.
* Don't mis-interpret sockaddr_in6 structures as sockaddr_in structuresbrian2000-07-201-1/+1
| | | | when purging routes.
* Add the ``resolv'' command for telling ppp how to deal with resolv.conf.brian2000-03-141-1/+17
| | | | | You can now ``resolv restore'' in ppp.linkdown ! Add DNS0 and DNS1 macros.
* Don't include netinet6/in6.h directly.brian2000-03-141-3/+0
|
* Don't ``break'' when we come accross a non-RTM_IFINFO typebrian2000-03-141-1/+1
| | | | | | | entry in the block returned by the NET_RT_IFLIST mib, ``continue'' Broken a few minutes ago by: me
* When ppp can't identify the relevant name, don't use "???", usebrian2000-03-141-5/+5
| | | | <nnn> or <0xxxx> instead.
* The interface list that comes back from the PF_ROUTE/NET_RT_IFLIST mibbrian2000-03-141-56/+56
| | | | | | is aligned. Teach this to ``show route''. Clean up some of the sockaddr parsing routines.
* Support IP6 addresses in ``show route''brian2000-03-141-12/+88
| | | | | Also, don't try to output routing entries if either the RTA_DST or RTA_GATEWAY sockaddrs aren't present.
* Back out the bogus #ifdef __NetBSD__ #include <signal.h> lines.brian1999-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>
* NetBSD has moved ``extern int errno;'' to signal.h :-/brian1999-09-201-0/+3
| | | | Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Rebuild the list of interface numbers to names if we're tryingbrian1999-08-261-3/+13
| | | | to evaluate an interface number that didn't previously exist.
* o Redesign the layering mechanism and make the aliasing code part ofbrian1999-05-081-1/+2
| | | | | | | | | | | | | | | | | | | | | 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''.
* Initial RADIUS support (using libradius). See the man page forbrian1999-01-281-26/+36
| | | | | | | | | | | | | | | | | | | details. Compiling with -DNORADIUS (the default for `release') removes support. TODO: The functionality in libradius::rad_send_request() needs to be supplied as a set of routines so that ppp doesn't have to wait indefinitely for the radius server(s). Instead, we need to get a descriptor back, select() on the descriptor, and ask libradius to service it when necessary. For now, ppp blocks SIGALRM while in rad_send_request(), so it misses PAP/CHAP retries & timeouts if they occur. Only PAP is functional. When CHAP is attempted, libradius complains that no User-Password has been specified... rfc2138 says that it *mustn't* be used for CHAP :-( Sponsored by: Internet Business Solutions Ltd., Switzerland
* Solve the ``first connection'' problem that occurs onbrian1998-10-221-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | demand-dial links with dynamic IP numbers where the program that causes the dial bind()s to an interface address that is subsequently changed after ppp negotiation. The problem is defeated by adding negotiated addresses to the tun interface as additional alias addresses and providing a set of ``iface'' commands for managing the interface. Libalias is also required (and what a name clash!) - it happily IP-aliases the address so that the source is that of the primary (negotiated) interface and un-IP-aliases it on the way back. An ``enable iface-alias'' is done implicitly by the -alias command line switch. If -alias isn't given, iface-aliasing is disabled by default and can't be enabled 'till an ``alias enable yes'' is done. ``alias enable no'' silently disables iface-alias. So, for dynamic-IP-type-connections, running ``ppp -alias -auto blah'' will work for the first connection, although existing bindings will not survive a disconnect/connect as the TCP peer will be trying to send to the old IP address - the packets won't route. It's now a lot easier to add IPXCP to ppp with minor updates to the new iface.[ch] (if anyone ever gets 'round to it). It's also now possible to manually add interface aliases with something like ``iface add 1.2.3.4/24 5.6.7.8''. This allows multi-homed ppp links :-)
* Don't lose an allocated pointer if realloc() fails.brian1998-08-171-4/+9
| | | | | Free it instead. Pointed out by: Theo de Raadt
* Silence ``Network unreachable'' warnings when usingbrian1998-07-281-6/+6
| | | | | | | | | | | | | | | | | | ``add .... HISADDR''. The network will never be reachable at this point unless we're in -auto or reading the command from ppp.linkup. We can now run the following lines and get the expected results: set ifaddr 1.2.3.4/0 5.6.7.8/0 add default HISADDR where a route is added immediately in auto mode and the whole thing is delayed 'till the IP numbers have been agreed in other modes. Essentially, ppp.linkup is no longer required.
* o Fix remaining sizeof problems for 64 bit machines.brian1998-06-271-8/+8
| | | | | | | | | | o Allow ``set ....'' when we have multiple links but aren't in multilink mode. o Do a TLS when we receive a ``Open'' event in ``Closed'' state, despite the rfc state transition table. This is clearly an error in the RFC as TLS cannot have yet been called (without TLF) in the ``Closed'' state. I've posted a message to comp.protocols.ppp for confirmation.
* Don't assume ``sizeof(u_long) == 4''brian1998-06-271-3/+3
| | | | Submitted by: Theo
* Change some log levels. ALERTs are only logged whenbrian1998-06-161-2/+3
| | | | | | something that can't happen happens or when everyone needs to know. ERRORs are only logged when something unexpected happens.
* o De-staticise things that don't need to be static.brian1998-06-151-3/+9
| | | | | | | | | | o Bring the static ``ttystate'' into struct prompt so that the tilde context is per prompt and not global. o Comment the remaining static variables so that it's clear why they're static. o Add some XXX comments suggesting that our interface list and our hostname should be re-generated after a signal (say SIGUSR1) so that a machine with PCCARDs has a chance.
* Fix a rather nasty use of `static'. This caused a SEGVbrian1998-06-151-2/+2
| | | | | when running ``link * load label'' as we ended up recursing back into command_Interpret after nuking our command arg list.
* Fix a couple of warnings noted with -Wall on FreeBSD-2.1.5.brian1998-06-101-5/+1
| | | | Pointed out by: Charlie Sorsby <crs@hgo.net>
* MFMP: Make ppp multilink capable.brian1998-05-211-200/+183
| | | | See the file README.changes, and re-read the man page.
* Fix diagnostic typo.brian1998-04-251-2/+2
|
* Add extraneous braces to stiffle warnings from gcc-2.8brian1998-03-131-8/+9
|
* Remove unused #includes.brian1998-01-211-3/+2
| | | | | | Make various bits static. Remove unused variables. Submitted by: eivind
* Reimplement proxy-arp address stuff using sysctl().brian1998-01-191-3/+2
|
* Remember any number of interface names.brian1998-01-111-13/+28
|
* Allow 6 byte interface names (for >tun99)brian1998-01-111-2/+2
|
* Allow "add! dst mask gw" (note the ``!'') to do anbrian1997-12-301-19/+27
| | | | | | | | RTM_CHANGE if the RTM_ADD fails with an EEXIST. Allow "delete! dst" (note the ``!'') to silently fail if the RTM_DELETE fails with an ESRCH. Also, make the ESRCH and EEXIST error conditions more understandable to the casual observer.
* Write to the routing socket as uid 0. It's not good enoughbrian1997-12-271-2/+2
| | | | to just open it as uid 0 under OpenBSD.
* Show who closes the diagnostic connection.brian1997-12-271-4/+6
| | | | | | Show the IP range (if specified) in "show ipcp". Close unused descriptors 0 and 2 in interactive mode. Pass (size_t *) rather than (int *) to sysctl().
* Cosmetic (style):brian1997-12-241-11/+11
| | | | | | | sizeof(var) -> sizeof var sizeof type -> sizeof(type) Suggested by: J Wunsch <j@uriah.heep.sax.de>
* Don't depend on a u_long being 32 bits.brian1997-12-171-6/+9
| | | | Pointed out by: Theo de Raadt <deraadt@cvs.openbsd.org>
* Fix a potential overflow where, if the label passed on the commandbrian1997-12-171-3/+3
| | | | | | | | line is > LINE_LEN (512 bytes), we scribble (*blush*). Hinted at by: Theo de Raadt <deraadt@cvs.openbsd.org> Change sprintf(buf, "fixedstring") to strcpy(buf, "fixedstring").
* Do 2 passes when "delete all"ing. The first pass removesbrian1997-12-151-28/+54
| | | | | | | | | | | | | | all RTF_WASCLONED routes, and the second removes the others. This avoids the situation where we've added an RTF_CLONING route (such as ``default''), created some clones, then deleted the CLONING route before the WASCLONED route(s). Without the two passes, we get errno (not rtm_errno) set to ESRCH when deleting the WASCLONED route, despite the deletion succeeding ! Also: Enhance the route operation failure diagnostics. Make portability #ifdefs a bit more generic.
* Allow random IP number allocation to peer.brian1997-12-131-6/+36
| | | | | | | | | | | | | | | | | | | | Validate the peers suggested IP by attempting to make a routing table entry. Give up IPCP negotiation if the peer NAKs us with an unusable IP. Always SIOCDIFADDR then SIOCAIFADDR when configuring the tun device. Using SIOCSIFDSTADDR allows duplicate dst addresses (which we don't want)!!! Allow up to 200 interface names (was 50) (now that ppp can play server properly). Up the version number (1.5 -> 1.6). Cosmetic: Log unexpected CCP packets in the CCP log rather than the ERROR log. Log unexpected Config Reqs in the appropriate LCP/IPCP/CCP log rather than the ERROR log. Log failed route additions and deletions with WARN, not TCPIP. Log the option id and length for unrecognised IPCP options. Change some .Sq to .Ar in the man page.
* Only allow one arg to `delete' - the mask & gateway aren't necessary.brian1997-12-071-34/+44
| | | | | | | | | | | | | | Delete AF_LINK routes as well as AF_INET. Allow the word `default' as the arg to `delete' or in place of the first two args (dest & netmask) to `add'. Accept INTERFACE as the third arg to `add'. You can now say `add default interface' to create a default route through the tun interface. It's reported that subsequent bind()s will bind to a broadcast address and not to the address currently assigned to the tun device - this is the first step towards supporting that first connection that was around from before the dynamic IP negotiation....
* Understand ``sockaddr_dl''s where sdl_nlen != 0brian1997-12-041-24/+25
|
* Understand how to derive the names of interfacesbrian1997-11-221-34/+28
| | | | | when they aren't ordered. This is probably vital for laptop support ;-I
* Fix prototypes.brian1997-11-221-8/+10
| | | | | | | | | | | | | | Remove extraneous decls. Add ``const'' to several places. Allow ``make NOALIAS=1'' to remove IP aliasing. Merge with OpenBSD - only the Makefiles vary. We can now survive a compile with -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Wchar-subscripts (although the Makefile just contains -Wall).
* Interpret AF_LINK sockaddrs correctly in show/delete route.brian1997-11-151-175/+230
| | | | | | | Print out inteface names rather than numbers, and use the same "find out the names" code in SetIfAddr(). This means that the nasty ioctl(,SIOCGIFCONF,)/realloc loop is now buried :-)
* Finish the security improvements:brian1997-11-111-2/+2
| | | | | | | | | | | | | | | | | | | o Add "allow" command: "allow users a b c" gives access to users a, b and c. "allow modes auto" gives those users access to auto mode only. "allow users *" and "allow modes *" are accepted. No users and all modes are allowed by default. UID 0 can do anything. o Set the current label with the "load" and "dial" commands so that the call to ppp.linkdown makes sense. o Up the verison number. o Don't OR MODE_AUTO for -background and -ddial. o Don't OR MODE_INTER when we get a diagnostic connection. o Allow up to 40 args per line (was 20). o "set ifaddr" only changes the interface in AUTO mode (with other modes, it happens after IPCP negotiation). o Sort command descriptions in the man page. o Support -dedicated mode where we just talk ppp forever (no login etc).
* Increase chat script sizes to 512brian1997-11-091-1/+2
| | | | Requested by: Michael Reifenberger <root@totum.plaut.de>
* Introduce ID0 logging.brian1997-11-091-7/+12
| | | | | | | | Stay as the invoking uid as much as possible. Execution as a normal user is still forbidden for now, so these changes are pretty ineffective. The next commit will implement the modifications suggested on -hackers a number of days ago.
* Don't include RTA_GATEWAY in rtm_addrs unless it's specified.brian1997-11-091-2/+3
|
* Don't pass global vars as args.brian1997-11-081-10/+10
| | | | Remove local/global conflicts.
* Cosmetic (no functional changes):brian1997-10-261-17/+19
| | | | | | | | | | | | | | | o Add missing $Id$s o Move extern decls from .c -> .h files o Staticize o Remove #includes from .h files o style(9)ify includes o bcopy -> memcpy bzero -> memset bcmp -> memcmp index -> strchr rindex -> strrchr o Move timeout.h -> timer.h (making it consistent w/ timer.c) o Add -Wmissing-prototypes
* Cosmetic: Make LogPrintf() calls consistent.brian1997-08-311-10/+13
|
OpenPOWER on IntegriCloud