summaryrefslogtreecommitdiffstats
path: root/sys/netatalk/ddp_input.c
Commit message (Collapse)AuthorAgeFilesLines
* Use queue(9) instead of hand-crafted link lists for the global netatalkrwatson2009-06-241-5/+3
| | | | | | | address list. Generally follow the style and convention of similar parts in netinet. MFC after: 6 weeks
* Add a global rwlock, at_ifaddr_rw, to protect the global netatalkrwatson2009-06-221-21/+25
| | | | | | | | | | | | | address lists, at_ifaddr_list. Acquire the lock, and use ifaddr refcounts where necessary, to close most known address-related races in netatalk. Annotate one potential race in at_control() where we acquire an ifaddr reference, drop the global lock, and scrub the address from the ifnet before re-acquiring the global lock, which could allow for a writer-writer race. MFC after: 3 weeks
* Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERICrwatson2009-06-051-2/+0
| | | | | | | | and used in a large number of files, but also because an increasing number of incorrect uses of MAC calls were sneaking in due to copy-and-paste of MAC-aware code without the associated opt_mac.h include. Discussed with: pjd
* Add internal 'mac_policy_count' counter to the MAC Framework, which is arwatson2009-06-021-5/+1
| | | | | | | | | | | | | | | | | | count of the number of registered policies. Rather than unconditionally locking sockets before passing them into MAC, lock them in the MAC entry points only if mac_policy_count is non-zero. This avoids locking overhead for a number of socket system calls when no policies are registered, eliminating measurable overhead for the MAC Framework for the socket subsystem when there are no active policies. Possibly socket locks should be acquired by policies if they are required for socket labels, which would further avoid locking overhead when there are policies but they don't require labeling of sockets, or possibly don't even implement socket controls. Obtained from: TrustedBSD Project
* Merge first in a series of TrustedBSD MAC Framework KPI changesrwatson2007-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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
* Clean up DDP layer netatalk code:rwatson2007-01-121-348/+288
| | | | | | | | | - General style(9) cleanup -- white space, braces, line wraps, etc. - Annotate a lack of synchronization the global route cache if the input routine is invoked with parallelism. - Remove unused debugging code.
* Break out my copyrights with our 2-clause BSD license from the UMichrwatson2007-01-081-2/+1
| | | | | | copyright, which while similar, is different. MFC after: 3 days
* 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
* /* -> /*- for license, minor formatting changes, insert COPYRIGHT into filesimp2005-01-071-2/+2
|
* Correct a misspelling in a comment.rwatson2004-12-051-1/+1
|
* Acquire socket receive buffer mutex before appending and then waking uprwatson2004-12-051-2/+4
| | | | | | a receive socket in DDP. This reduces the number of mutex operations required to deliver to a socket by two, and is the model used in other protocols.
* Inline umich license from COPYRIGHT to make it clear what license therwatson2004-08-101-4/+45
| | | | | | | | | umich copyright is asserting. Clarify that the copyright I'm asserting is the standard Berkeley license. Remove Giant assertions from AARP and DDP input routines.
* Procotol control block locking for netatalk DDP.rwatson2004-07-121-6/+12
|
* Socket MAC labels so_label and so_peerlabel are now protected byrwatson2004-06-131-0/+3
| | | | | | | | | | | | | SOCK_LOCK(so): - Hold socket lock over calls to MAC entry points reading or manipulating socket labels. - Assert socket lock in MAC entry point implementations. - When externalizing the socket label, first make a thread-local copy while holding the socket lock, then release the socket lock to externalize to userspace.
* Rename 'at_ifaddr' list to 'at_ifaddr_list' so that the variable isrwatson2004-03-221-3/+3
| | | | more easily mechanically distinguished from 'struct at_ifaddr'.
* Compare pointers with NULL rather than 0, or treating them as boolans inrwatson2004-03-221-2/+2
| | | | | | | if statements. at_rmx gets a $FreeBSD$ out of the deal also (this code appears to be unused).
* Also modify ddp_input.c with the following changes previously appliedrwatson2004-03-221-90/+90
| | | | | | | | | | | | | | to other files in netatalk: Log: Since I have my hands all over netatalk adding locking and restructuring it, cinch the file's style closer to style(9) with regard to parenthesis: s/( /(/g s/ )/)/g s/return(/return (/g s/return 0/return (0)/ s/return 1/return (1)/
* Spell "(struct foo *)0" as "NULL".rwatson2004-03-211-7/+6
|
* o add a flags parameter to netisr_register that is used to specifysam2003-11-081-0/+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
* Update netisr handling; Each SWI now registers its queue, and all queuejlemon2003-03-041-61/+26
| | | | | | | | | | 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
* Introduce experimental support for MAC in the AppleTalk/EtherTalk stack.rwatson2002-08-151-0/+10
| | | | | | | | | Label link layer mbufs as they are created for transmission, check mbufs before delivering them to sockets, label mbufs as they are created from sockets, and preserve mbuf labels if mbufs are copied. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Back out my lats commit of locking down a socket, it conflicts with hsu's work.tanimura2002-05-311-2/+0
| | | | Requested by: hsu
* Lock down a socket, milestone 1.tanimura2002-05-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Add a mutex (sb_mtx) to struct sockbuf. This protects the data in a socket buffer. The mutex in the receive buffer also protects the data in struct socket. o Determine the lock strategy for each members in struct socket. o Lock down the following members: - so_count - so_options - so_linger - so_state o Remove *_locked() socket APIs. Make the following socket APIs touching the members above now require a locked socket: - sodisconnect() - soisconnected() - soisconnecting() - soisdisconnected() - soisdisconnecting() - sofree() - soref() - sorele() - sorwakeup() - sotryfree() - sowakeup() - sowwakeup() Reviewed by: alfred
* Revert the change of #includes in sys/filedesc.h and sys/socketvar.h.tanimura2002-04-301-3/+6
| | | | | | | | | | Requested by: bde Since locking sigio_lock is usually followed by calling pgsigio(), move the declaration of sigio_lock and the definitions of SIGIO_*() to sys/signalvar.h. While I am here, sort include files alphabetically, where possible.
* Make `options NETATALK' compile after the -fno-common changes.iedowse2002-01-161-2/+0
| | | | Tested by: Emiel Kollof <coolvibe@hackerheaven.org>
* Clean up some loose ends in the network code, including the X.25 and ISOpeter2000-02-131-1/+7
| | | | | | | #ifdefs. Clean out unused netisr's and leftover netisr linker set gunk. Tested on x86 and alpha, including world. Approved by: jkh
* Move the *intrq variables into net/intrq.c and unconditionallybrian2000-01-241-2/+5
| | | | | | | | | | | include this in all kernels. Declare some const *intrq_present variables that can be checked by a module prior to using *intrq to queue data. Make the if_tun module capable of processing atm, ip, ip6, ipx, natm and netatalk packets when TUNSIFHEAD is ioctl()d on. Review not required by: freebsd-hackers
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-071-1/+0
| | | | and local variables, goto labels, and functions declared but not defined.
* spurious ntohs calls were stopping some packets from being recognisedjulian1998-06-051-6/+6
| | | | | for what they are.. Taken from the netatalk mailing list. from a NetBSD user.
* Fix various problems with netatalk kernel support.julian1997-10-291-49/+146
| | | | | | | | Some of these changes are a bit rough and will become more polished later. the changes to if_ethersubr should largely be moved to within the appletalk code, but that will happen later. A few of these were related to network-byteorder problems, and more were related to loopback failures.
* Removed unused #includes.bde1997-09-071-5/+0
|
* Staticicized.bde1997-09-071-7/+5
|
* Fixed another sloppy common-style declaration (staticized it).bde1997-09-071-0/+2
|
* Fixed sloppy common-style declarations.bde1997-09-071-0/+2
|
* Updated #includes to 4.4Lite style.bde1996-09-101-5/+5
|
* Submitted by: archie@whistle.comjulian1996-07-231-46/+5
| | | | appletalk cleanups
* Obtained from: netatalk distribution netatalk@itd.umich.edujulian1996-05-241-0/+413
Kernel Appletalk protocol support both CAP and netatalk can make use of this.. still needs some owrk but it seemd the right tiime to commit it so other can experiment.
OpenPOWER on IntegriCloud