summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/route.c
Commit message (Collapse)AuthorAgeFilesLines
* Cast unsigned variables to intbrian2005-01-101-1/+1
|
* Add a bunch of malloc() return checksbrian2004-10-111-5/+15
| | | | | PR: 71592 Submitted by: Dan Lukes <dan@obluda.cz> with further changes
* Make ppp WARNS=5 cleanbrian2004-09-051-3/+3
|
* We need filling scopeid to install routes for link-localume2003-03-251-0/+24
| | | | scope addresses.
* Include the correct file (stdarg.h) and use va_list rather than _BSD_VA_LIST_brian2002-08-271-0/+1
| | | | Suggested by: mike
* o Clean up some #includesbrian2002-05-141-13/+12
| | | | | | | | | | | | | | | | | | o Bump version number to 3.0.4 o When talking to a RADIUS server, provide a NAS-Port-Type. When the NAS-Port-Type is Ethernet, provide a NAS-Port value equal to the SESSIONID from the environment in direct mode or the NGM_PPPOE_SESSIONID message in other modes. If no SESSIONID is found, default to the interface index in client mode or zero in server mode. When the NAS-Port-Type is ISDN, set the NAS-Port to the minor number of the physical device (ie, the N in /dev/i4brbchN). This makes it easier for the RADIUS server to identify the client WRT accounting data etc. Prompted by: lsz8425 <lsz8425@mail.cd.hn.cn>
* Remove some extraneous whitespacebrian2002-03-311-1/+1
|
* Don't use the RTF_GATEWAY flag and pass the RTA_GATEWAY address when updatingbrian2002-03-301-1/+8
| | | | routes.
* Merge the NETGRAPH branch into HEAD. tty devices now use netgraph's linebrian2002-03-301-1/+1
| | | | | | | | 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.
* socket()s first argument should be a protocol family rather than anbrian2002-01-161-2/+2
| | | | address family.
* socket's first argument is an address family, not a protocol family.brian2002-01-161-2/+2
|
* Don't provide an RTA_GATEWAY sockaddr when we write RTM_CHANGE messagesbrian2001-11-301-6/+0
| | | | | | | | | | | | to the routing socket. The local address on a point-to-point interface is not actually a gateway address - despite it appearing in the second column of netstat -r's output. Providing a gateway to an RTM_CHANGE will currently change the route's interface so that it's using the specified gateway - not what we want. Patiently explained to me by: ru
* Remove the hack that ensures that rt_Update() works on FreeBSD. Nowbrian2001-11-231-23/+5
| | | | | that the ncpaddr code doesn't create default routes with non-zero masks, everything works as it should.
* When writing messages to the routing socket, round sockaddr sizesbrian2001-11-231-12/+19
| | | | | | | up in the same way that we expect them to be when we read them. This is a no-op on i386 and probably on alphas, as we currently only support AF_INET and AF_INET6.
* Be paranoid about non-zero netmasks being associated with INET addressesbrian2001-11-231-0/+2
| | | | | | | | | | | | | of 0.0.0.0. The OpenBSD PF_ROUTE/NET_RT_DUMP sysctl is sending back routes with RTAX_NETMASK set, but the corresponding sockaddr being 4 zero bytes (with an address family of zero). ppp was getting confused by this and ending up interpreting it as a 0.0.0.0/32 routing table destination and subsequently failing to do anything with the route. Specifically, after this fix, ppp under OpenBSD can successfully change and delete the default route again !
* Remove an unused variable (oops)brian2001-11-231-1/+1
|
* Don't adjust_linklocal() when pulling a sockaddr out of an ncpaddr orbrian2001-11-231-8/+2
| | | | | | | | | | | | | ncprange structure. Don't write() the netmask for IPv6 sockaddrs to the routing socket if the prefixlen is 128. It seems that messages written to the routing socket with the scopeid set for link local addresses are not understood. Instead, we have to put the scopeid in the 5th and 6th bytes of the address (see adjust_linklocal() in ncpaddr.c). I think this may be a bug in the KAME implementation - it should really understand both forms.
* Fix a diagnosticbrian2001-09-041-1/+1
|
* When attempting to change the default route, don't write the gatewaybrian2001-08-201-7/+26
| | | | | | | | | | and mask to the routing socket, otherwise the update fails. Warning provided by: markm The code here was broken for FreeBSD when IPv6 support was added, but was fixed for OpenBSD. OpenBSD expects the gateway and mask to be supplied and fails the update otherwise.
* Build properly with -DNOINET6brian2001-08-181-2/+2
|
* Specify the gateway address when updating the MTU and send/recv pipebrian2001-08-161-24/+37
| | | | | | | | | | 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>
* Don't forget to attache the sticky route change to the ncp structure.brian2001-08-151-0/+1
| | | | PR: 29726
* o Add ipv6 support, abstracting most NCP addresses into opaquebrian2001-08-141-220/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Handle hardware-imposed MTU/MRU limitations. PPPoE will no longerbrian2001-06-181-4/+3
| | | | | | | | | | | | 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
* Convert IIJ copyrights to BSD copyrights.brian2001-06-131-17/+24
| | | | Approved by: Toshiharu OHNO <tohno@sirius.ocn.ne.jp>
* When we change the interface MTU, run through the routing table and tweakbrian2001-04-051-13/+259
| | | | all route MTUs too.
* 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.
OpenPOWER on IntegriCloud