summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/iface.c
Commit message (Collapse)AuthorAgeFilesLines
* Correctly handle ifr.ifr_flags/ifr.ifr_flagshigh like ifconfig(8) does.sobomax2002-08-291-3/+6
| | | | MFC after: 1 day
* 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-2/+2
|
* o Clean up some #includesbrian2002-05-141-2/+0
| | | | | | | | | | | | | | | | | | 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>
* socket()s first argument should be a protocol family rather than anbrian2002-01-161-1/+1
| | | | address family.
* Pay attention to failures to SIOCAIFADDR and SIOCDIFFADDR.brian2001-11-301-25/+39
|
* Add some DEBUG logging to tell us when interface addresses are beingbrian2001-11-301-0/+14
| | | | added and removed
* Add a ``log'' command for logging specific information.brian2001-11-031-1/+1
| | | | | | | | | | | | | | 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)
* Some cosmetic changes to sync with OpenBSDbrian2001-08-271-0/+2
|
* o Enable IFF_MULTICAST when first opening the tun device (and keep the flagbrian2001-08-211-1/+8
| | | | | | 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''.
* Properly change old interface addresses so that their destination isbrian2001-08-201-1/+2
| | | | 255.255.255.255 if our new destination address conflicts.
* Avoid a compiler warningbrian2001-08-191-0/+2
| | | | | Not spotted by: FreeBSD's gcc version 2.95.3 20010315 (release) Spotted by: OpenBSD's gcc version 2.95.3 20010125 (prerelease)
* Don't show a prefixlen when a destination address is presentbrian2001-08-151-1/+2
| | | | in ``show iface''.
* o Add ipv6 support, abstracting most NCP addresses into opaquebrian2001-08-141-232/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+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
* Handle situations where we've already got a P2P interface addressbrian2001-05-021-1/+6
| | | | | | | | | | | | | | | of a/x -> b and then negotiate a/x -> c by simply expecting SIOCAIFADDR to do the change. This was broken by the last commit that optimised out the deletion and re-addition of the same a/x -> b combination, and forgot to compare the old/new destination addresses. Conveniently enough, this problem didn't effect setups where the default route goes via the ppp link, and most other setups don't care what the the destination address is actually set to. It broke test environments where ppp connects to the local machine rather badly though....
* Be a bit more persistent when the NET_RT_IFLIST sysctl returns ENOMEMbrian2001-04-031-18/+27
| | | | rather than dropping out immediately.
* Bring the PPPoE interface UP if requiredbrian2001-03-281-6/+6
| | | | Suggested by: archie
* If we're adding an interface address that is already one of the interface'sbrian2001-03-251-33/+52
| | | | | | | | | aliases with the same netmask and destination, don't remove it and then re-add exactly the same thing. This means that static (non-sticky) routes that use the interface address (or destination address) as a destination will not suddenly evaporate when IPCP comes up (not unless the negotiated IPs have changed anyway).
* Mention the MTU in ``show iface''.brian2000-12-011-2/+2
|
* Don't mis-match interface names in iface_Create()brian2000-06-191-2/+3
| | | | Submitted by: Adrian Penisoara <ady@freebsd.ady.ro>
* The interface list that comes back from the PF_ROUTE/NET_RT_IFLIST mibbrian2000-03-141-33/+35
| | | | | | is aligned. Teach this to ``show route''. Clean up some of the sockaddr parsing routines.
* Don't set ifaddr::in_addrs to 1 after an ``iface clear'' on an interfacebrian2000-01-071-5/+7
| | | | with no addresses.
* Add the -unit command line switch for specifying the tun device.brian1999-10-191-1/+3
| | | | | | 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.
* Correct a few diagnosticsbrian1999-10-161-3/+3
|
* 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
|
* Remember if MYADDR or HISADDR is used in a filter add tweak allbrian1999-05-311-2/+2
| | | | filters any time either value changes.
* Move the code for tweaking interface flags into one function.brian1999-05-271-1/+54
|
* 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''.
* #include <errno.h>, not <sys/errno.h>brian1999-04-261-4/+4
|
* Initial RADIUS support (using libradius). See the man page forbrian1999-01-281-2/+5
| | | | | | | | | | | | | | | | | | | 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
* Fix the interface alias code. Previously, I was expecting somethingbrian1998-10-261-12/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | like tun0: flags=blah 10.0.0.1 -> 10.0.0.100 10.0.0.2 -> 10.0.0.100 10.0.0.3 -> 10.0.0.100 to DTRT, despite the SIOCAIFADDR for each new alias returning -1 & EEXIST while adding the alias anyway. In real life, once we have the second alias with the same destination, nothing will route any more ! Also, because I was ignoring EEXIST, the dynamic IP assignment code was assigning duplicate addresses ('cos it was being lied to by iface_inAdd()). Now we have tun0: flags=blah 10.0.0.1 -> 255.255.255.255 10.0.0.2 -> 10.0.0.100 10.0.0.3 -> 255.255.255.255 This works - stuff bound to 10.1 & 10.3 will be considered alive by the kernel, and when they route back to the tun device, the packets get aliased to 10.2 and go out to 10.100 (as with the original plan). We still see the EEXIST in SIOCAIFADDR, but ignore it when our destination is 255.255.255.255, assuming that the alias *was* actually added. Additionally, ``iface add'' may now optionally be given only the interface address. The mask & destination default to 255.255.255.255.
* Solve the ``first connection'' problem that occurs onbrian1998-10-221-0/+431
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 :-)
OpenPOWER on IntegriCloud