summaryrefslogtreecommitdiffstats
path: root/sys/net/if_ppp.c
Commit message (Collapse)AuthorAgeFilesLines
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+3
|
* Don't abuse tp->t_sc, as it is now used by tty drivers.cognet2004-11-071-0/+16
| | | | | | This fixes the panic that occurs when using ppp(4) Reported and tested by: Yann Berthier (yb at sainte-barbe dot org)
* Apply error and success logic consistently to the function netisr_queue() andandre2004-08-271-2/+2
| | | | | | | | | | | | | | | | | | its users. netisr_queue() now returns (0) on success and ERRNO on failure. At the moment ENXIO (netisr queue not functional) and ENOBUFS (netisr queue full) are supported. Previously it would return (1) on success but the return value of IF_HANDOFF() was interpreted wrongly and (0) was actually returned on success. Due to this schednetisr() was never called to kick the scheduling of the isr. However this was masked by other normal packets coming through netisr_dispatch() causing the dequeueing of waiting packets. PR: kern/70988 Found by: MOROHOSHI Akihiko <moro@remus.dti.ne.jp> MFC after: 3 days
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-151-0/+2
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Major overhaul of pseudo-interface cloning. Highlights include:brooks2004-06-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Split the code out into if_clone.[ch]. - Locked struct if_clone. [1] - Add a per-cloner match function rather then simply matching names of the form <name><unit> and <name>. - Use the match function to allow creation of <interface>.<tag> vlan interfaces. The old way is preserved unchanged! - Also the match function to allow creation of stf(4) interfaces named stf0, stf, or 6to4. This is the only major user visible change in that "ifconfig stf" creates the interface stf rather then stf0 and does not print "stf0" to stdout. - Allow destroy functions to fail so they can refuse to delete interfaces. Currently, we forbid the deletion of interfaces which were created in the init function, particularly lo0, pflog0, and pfsync0. In the case of lo0 this was a panic implementation so it does not count as a user visiable change. :-) - Since most interfaces do not need the new functionality, an family of wrapper functions, ifc_simple_*(), were created to wrap old style cloner functions. - The IF_CLONE_INITIALIZER macro is replaced with a new incompatible IFC_CLONE_INITIALIZER and ifc_simple consumers use IFC_SIMPLE_DECLARE instead. Submitted by: Maurycy Pawlowski-Wieronski <maurycy at fouk.org> [1] Reviewed by: andre, mlaier Discussed on: net
* Link ALTQ to the build and break with ABI for struct ifnet. Please recompilemlaier2004-06-131-2/+4
| | | | | | | | | | | | your (network) modules as well as any userland that might make sense of sizeof(struct ifnet). This does not change the queueing yet. These changes will follow in a seperate commit. Same with the driver changes, which need case by case evaluation. __FreeBSD_version bump will follow. Tested-by: (i386)LINT
* First pass at softc list locking for if_ppp.c. Many parts ofrwatson2004-04-191-10/+43
| | | | | | | | | this patch were submitted by Maurycy Pawlowski-Wieronski. In addition to Maurycy's change, break out softc tear down from ppp_clone_destroy() into ppp_destroy() rather than performing a convoluted series of extraction casts and indirections during tear down at mod unload. Submitted by: Maurycy Pawlowski-Wieronski <maurycy@fouk.org>
* If IF_HANDOFF() or netisr_queue() fail, they will free the mbuf. Whenrwatson2004-04-151-0/+1
| | | | | | | this happens, set (m) to NULL or we'll try to free it a second time on return. Submitted by: Pavel Gulchouck <gul@gul.kiev.ua>
* Don't leak softc's when destroying interfaces.brooks2004-01-211-0/+3
| | | | | | Init the softc list when loaded. Noticed by: Maurycy Pawlowski-Wieronski <maurycy at fouk dot org>
* Introduce ip_fastforward and remove ip_flow.andre2003-11-141-1/+1
| | | | | | | | | | | | | | | Short description of ip_fastforward: o adds full direct process-to-completion IPv4 forwarding code o handles ip fragmentation incl. hw support (ip_flow did not) o sends icmp needfrag to source if DF is set (ip_flow did not) o supports ipfw and ipfilter (ip_flow did not) o supports divert, ipfw fwd and ipfilter nat (ip_flow did not) o returns anything it can't handle back to normal ip_input Enable with sysctl -w net.inet.ip.fastforwarding=1 Reviewed by: sam (mentor)
* o add a flags parameter to netisr_register that is used to specifysam2003-11-081-1/+3
| | | | | | | | | | | | | | | | whether or not the isr needs to hold Giant when running; Giant-less operation is also controlled by the setting of debug_mpsafenet o mark all netisr's except NETISR_IP as needing Giant o add a GIANT_REQUIRED assertion to the top of netisr's that need Giant o pickup Giant (when debug_mpsafenet is 1) inside ip_input before calling up with a packet o change netisr handling so swi_net runs w/o Giant; instead we grab Giant before invoking handlers based on whether the handler needs Giant o change netisr handling so that netisr's that are marked MPSAFE may have multiple instances active at a time o add netisr statistics for packets dropped because the isr is inactive Supported by: FreeBSD Foundation
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-6/+5
| | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
* o netisr_queue() returns 1 on success and 0 on failure,maxim2003-03-271-1/+1
| | | | | | fix a typo (?) in rev. 1.90. PR: kern/50163
* Update netisr handling; Each SWI now registers its queue, and all queuejlemon2003-03-041-15/+12
| | | | | | | | | | drain routines are done by swi_net, which allows for better queue control at some future point. Packets may also be directly dispatched to a netisr instead of queued, this may be of interest at some installations, but currently defaults to off. Reviewed by: hsu, silby, jayanth, sam Sponsored by: DARPA, NAI Labs
* Back out M_* changes, per decision of the TRB.imp2003-02-191-6/+6
| | | | Approved by: trb
* A minor stylistic change to make it more clear to lint-like tools.phk2003-02-021-2/+2
|
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-6/+6
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* network interface and link layer changes:sam2002-11-151-4/+2
| | | | | | | | | | | | o on input don't strip the Ethernet header from packets o input packet handling is now done with if_input o track changes to ether_ifattach/ether_ifdetach API o track changes to bpf tapping o call ether_ioctl for default handling of ioctl's o use constants from net/ethernet.h where possible Reviewed by: many Approved by: re
* Convert most printf()s to if_printf()s.brooks2002-09-241-15/+10
|
* Use m_length() instead of home-rolled versions.phk2002-09-181-13/+4
|
* Fix a couple of bogus return values in previous commit.brooks2002-08-191-3/+2
| | | | | Submitted by: "Vladimir B. " Grebenschikov <vova@sw.ru> Pointy hat to: brooks
* Move mac.h include to match the MAC tree location. Both locationsrwatson2002-08-151-1/+1
| | | | | | | are about equally as alphabetized. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Make ppp(4) devices clonable and unloadable.brooks2002-08-091-34/+78
|
* Introduce support for Mandatory Access Control and extensiblerwatson2002-08-011-0/+17
| | | | | | | | | | | | kernel access control. Add MAC support for if_ppp. Label packets as they are removed from the raw PPP mbuf queue. Preserve the mbuf MAC label across various PPP data-munging and reconstitution operations. Perform access control checks on mbufs to be transmitted via the interface. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-3/+3
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Replace (deprecated ?) FREE() macro with direct calls to free()luigi2002-04-041-6/+6
|
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-8/+8
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Remove __P.alfred2002-03-191-8/+8
|
* Remove duplicated and wrong sc->sc_last_recv setting. It unbreaksmaxim2002-03-051-4/+1
| | | | | | | | | | | active-filter in pppd(8). PR: kern/12281 Submitted by: Tim Moore <moore@bricoworks.com> Not objected by: peter Reviewed by: ru Approved by: ru MFC after: 1 week
* Get rid of the twisted MFREE() macro entirely.dillon2002-02-051-2/+3
| | | | | Reviewed by: dg, bmilekic MFC after: 3 days
* Staticise private interface lists.msmith2002-01-081-1/+1
|
* KSE Milestone 2julian2001-09-121-2/+3
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Fix some signed/unsigned integer confusion, and add bounds checking ofkris2001-09-101-1/+2
| | | | | | | | arguments to some functions. Obtained from: NetBSD Reviewed by: peter MFC after: 2 weeks
* Quieten gcc.peter2001-01-311-0/+1
|
* Exterminate the use of PSEUDO_SET() with extreme prejudice.peter2001-01-311-6/+25
|
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-52/+47
| | | | | | | | | | | | | | before adding/removing packets from the queue. Also, the if_obytes and if_omcasts fields should only be manipulated under protection of the mutex. IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on the queue. An IF_LOCK macro is provided, as well as the old (mutex-less) versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which needs them, but their use is discouraged. Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF, which takes care of locking/enqueue, and also statistics updating/start if necessary.
* Remove some #if NFOO > 0 that are always true because of config rules.peter2000-01-291-3/+0
|
* Minor tidy up of PPP_FILTER and NBPF stuff. Don't generate bpf.h in thepeter1999-09-261-7/+1
| | | | module and don't #include "bpf.h".
* Remove NBPF conditionality of bpf calls in most of our network drivers.phk1999-09-251-8/+0
| | | | | | | | | | | | This means that we will not have to have a bpf and a non-bpf version of our driver modules. This does not open any security hole, because the bpf core isn't loadable The drivers left unchanged are the "cross platform" drivers where the respective maintainers are urged to DTRT, whatever that may be. Add a couple of missing FreeBSD tags.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Back out redundant checksbrian1999-08-061-7/+3
| | | | Pointed out by: bde
* Define IF_MAXMTU and IF_MINMTU and don't allow MTUs withbrian1999-08-061-3/+7
| | | | | | | | | out-of-range values. ``comparison is always 0'' warnings are silly ! Ok'd by: wollman, dg Advised by: bde
* Rename bpfilter to bpf.des1999-07-061-7/+7
|
* Suser() simplification:phk1999-04-271-8/+8
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Merge ppp changes from 2.3.3 -> 2.3.5. I have spotted some morepeter1998-06-201-8/+3
| | | | problems, which I'll have a go at shortly.
* This commit fixes various 64bit portability problems required fordfr1998-06-071-4/+6
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Added fast IP forwarding code by Matt Thomas <matt@3am-software.com> viadg1998-05-191-1/+5
| | | | | | | | | | | | NetBSD, ported to FreeBSD by Pierre Beyssac <pb@fasterix.freenix.org> and minorly tweaked by me. This is a standard part of FreeBSD, but must be enabled with: "sysctl -w net.inet.ip.fastforwarding=1" ...and of course forwarding must also be enabled. This should probably be modified to use the zone allocator for speed and space efficiency. The current algorithm also appears to lose if the number of active paths exceeds IPFLOW_MAX (256), in which case it wastes lots of time trying to figure out which cache entry to drop.
* Use getmicrotime() for if_lastchange, 10msec is plenty precision.phk1998-04-061-2/+2
|
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
* ppp-2.3.x ships with a bad compression number for deflate. It uses numberpeter1998-03-221-1/+7
| | | | | | | 24 (which is magnalink!) rather than the correct 26. Initial attempt at a compatability kludge that will negotiate for either but will prefer to use the correct deflate compression type.
OpenPOWER on IntegriCloud