summaryrefslogtreecommitdiffstats
path: root/sys/net/if_ppp.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove if_ppp(4) and if_sl(4).ed2009-04-051-1733/+0
| | | | | | | | | | | | | Not only did these two drivers depend on IFF_NEEDSGIANT, they were broken 7 months ago during the MPSAFE TTY import. if_ppp(4) has been replaced by ppp(8). There is no replacement for if_sl(4). If we see regressions in for example the ports tree, we should just use __FreeBSD_version 800045 to check whether if_ppp(4) and if_sl(4) are present. Version 800045 is used to denote the import of MPSAFE TTY. Discussed with: rwatson, but also rwatson's IFF_NEEDSGIANT emails on the lists.
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-231-2/+2
| | | | MFC after: 3 months
* Remove NETISR_MPSAFE, which allows specific netisr handlers to be directlyrwatson2008-07-041-3/+4
| | | | | | | | | | | | | | | | | | | | | | | dispatched without Giant, and add NETISR_FORCEQUEUE, which allows specific netisr handlers to always be dispatched via a queue (deferred). Mark the usb and if_ppp netisr handlers as NETISR_FORCEQUEUE, and explicitly acquire Giant in those handlers. Previously, any netisr handler not marked NETISR_MPSAFE would necessarily run deferred and with Giant acquired. This change removes Giant scaffolding from the netisr infrastructure, but NETISR_FORCEQUEUE allows non-MPSAFE handlers to continue to force deferred dispatch so as to avoid lock order reversals between their acqusition of Giant and any calling context. It is likely we will be able to remove NETISR_FORCEQUEUE once IFF_NEEDSGIANT is removed, as non-MPSAFE usb and if_ppp drivers will no longer be supported. Reviewed by: bz MFC after: 1 month X-MFC note: We can't remove NETISR_MPSAFE from stable/7 for KPI reasons, but the rest can go back.
* Merge first in a series of TrustedBSD MAC Framework KPI changesrwatson2007-10-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | from Mac OS X Leopard--rationalize naming for entry points to the following general forms: mac_<object>_<method/action> mac_<object>_check_<method/action> The previous naming scheme was inconsistent and mostly reversed from the new scheme. Also, make object types more consistent and remove spaces from object types that contain multiple parts ("posix_sem" -> "posixsem") to make mechanical parsing easier. Introduce a new "netinet" object type for certain IPv4/IPv6-related methods. Also simplify, slightly, some entry point names. All MAC policy modules will need to be recompiled, and modules not updates as part of this commit will need to be modified to conform to the new KPI. Sponsored by: SPARTA (original patches against Mac OS X) Obtained from: TrustedBSD Project, Apple Computer
* Continue pre-7.0 privilege cleanup: update suser(9) comments to be priv(9)rwatson2007-07-021-2/+2
| | | | | | comments. Approved by: re (bmah)
* Replace a suser() check with an explicit check for PRIV_NET_SETIFMTU.rwatson2007-02-201-1/+2
|
* Use callout mechanism instead of timeout()/untimeout().ume2006-12-051-0/+1
| | | | MFC after: 1 week
* Teach an IPv6 to ppp(4).ume2006-11-111-0/+54
| | | | | Obtained from: NetBSD MFC after: 1 week
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-061-7/+18
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.hrwatson2006-10-221-1/+2
| | | | | | | | | | | | | begun with a repo-copy of mac.h to mac_framework.h. sys/mac.h now contains the userspace and user<->kernel API and definitions, with all in-kernel interfaces moved to mac_framework.h, which is now included across most of the kernel instead. This change is the first step in a larger cleanup and sweep of MAC Framework interfaces in the kernel, and will not be MFC'd. Obtained from: TrustedBSD Project Sponsored by: SPARTA
* Fix error in rev. 1.68. The intention was to break out the switch(){},glebius2006-10-211-1/+1
| | | | | | | | but actually exited from the for(){} loop. This fixes the PPPIOCSCOMPRESS ioctl. PR: kern/101333 Submitted by: Igor Popov <igorpopov newmail.ru>
* Revise network interface cloning to take an optional opaquesam2006-07-091-3/+3
| | | | | | | | | parameter that can specify configuration parameters: o rev cloner api's to add optional parameter block o add SIOCCREATE2 that accepts parameter data o rev vlan support to use new api (maintain old code) Reviewed by: arch@
* Add IFF_NEEDSGIANT to kernel PPP support. I have no idea why this wasn'trwatson2006-03-301-1/+1
| | | | | | here, but it should have been. MFC after: 3 days
* Return mbuf pointer or NULL from ip_fastforward() as the mbuf pointerandre2006-01-181-1/+1
| | | | | | | | | | | may have changed by m_pullup() during fastforward processing. While this is a bug it is actually never triggered in real world situations and it is not remotely exploitable. Found by: Coverity Prevent(tm) Coverity ID: CID780 Sponsored by: TCP/IP Optimization Fundraise 2005
* Fix -Wundef.ru2005-12-041-4/+4
|
* Move the cloned interface list management in to if_clone. For some drivers thethompsa2005-11-081-8/+0
| | | | | | | | | | softc lists and associated mutex are now unused so these have been removed. Calling if_clone_detach() will now destroy all the cloned interfaces for the driver and in most cases is all thats needed to unload. Idea by: brooks Reviewed by: brooks
* Change the reference counting to count the number of cloned interfaces for eachthompsa2005-10-121-17/+8
| | | | | | | | | | | | | | | cloner. This ensures that ifc->ifc_units is not prematurely freed in if_clone_detach() before the clones are destroyed, resulting in memory modified after free. This could be triggered with if_vlan. Assert that all cloners have been destroyed when freeing the memory. Change all simple cloners to destroy their clones with ifc_simple_destroy() on module unload so the reference count is properly updated. This also cleans up the interface destroy routines and allows future optimisation. Discussed with: brooks, pjd, -current Reviewed by: brooks
* Use monotonic time_uptime instead of 'time_second' as timebaseandre2005-09-191-7/+7
| | | | for timeouts.
* Axe ppp_for_tty(). Use tty->t_lsc pointer to store sc. Thisglebius2005-08-121-16/+0
| | | | | | | | also eliminates recursive use of ppp_softc_list_mtx. PR: kern/84686 Reviewed by: phk MFC after: 1 week
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-3/+4
| | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days
* Eliminate MAC entry point mac_create_mbuf_from_mbuf(), which isrwatson2005-07-051-2/+2
| | | | | | | | | | | redundant with respect to existing mbuf copy label routines. Expose a new mac_copy_mbuf() routine at the top end of the Framework and use that; use the existing mpo_copy_mbuf_label() routine on the bottom end. Obtained from: TrustedBSD Project Sponsored by: SPARTA, SPAWAR Approved by: re (scottl)
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-34/+41
| | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam
* /* -> /*- 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
|
OpenPOWER on IntegriCloud