summaryrefslogtreecommitdiffstats
path: root/sys/netatalk/ddp_output.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge r262763, r262767, r262771, r262806 from head:glebius2014-03-211-1/+1
| | | | | | | | | | - Remove rt_metrics_lite and simply put its members into rtentry. - Use counter(9) for rt_pksent (former rt_rmx.rmx_pksent). This removes another cache trashing ++ from packet forwarding path. - Create zini/fini methods for the rtentry UMA zone. Via initialize mutex and counter in them. - Fix reporting of rmx_pksent to routing socket. - Fix netstat(1) to report "Use" both in kvm(3) and sysctl(3) mode.
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-051-2/+2
| | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually
* Use queue(9) instead of hand-crafted link lists for the global netatalkrwatson2009-06-241-1/+1
| | | | | | | 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-1/+9
| | | | | | | | | | | | | 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
* Don't lock sockets around calls to mac_socket_create_mbuf() -- policiesrwatson2009-06-201-2/+0
| | | | | | are now expected to acquire the socket lock if they require them. Obtained from: TrustedBSD Project
* 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
* Annotate two possible bugs in a comment: (1) we allocate and explicitlyrwatson2007-11-201-0/+8
| | | | | | | | prepend a data mbuf in front of a header mbuf without moving the header to the new mbuf, and (2) a possible alignment problem on architectures with strict alignment as reported in kern/4184. PR: kern/4184 (1)
* Merge first in a series of TrustedBSD MAC Framework KPI changesrwatson2007-10-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 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-153/+143
| | | | | | | | | - 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.
* 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
* Use the correct mbuf type for MGET().andre2005-08-301-1/+1
|
* Eliminate MAC entry point mac_create_mbuf_from_mbuf(), which isrwatson2005-07-051-1/+1
| | | | | | | | | | | 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)
* In the ddp_output() path, which can be called in a variety of threadingrwatson2005-02-221-2/+2
| | | | | | and locking contexts, use a non-sleeping allocation for mbufs. MFC after: 1 week
* /* -> /*- for license, minor formatting changes, insert COPYRIGHT into filesimp2005-01-071-1/+1
|
* Socket MAC labels so_label and so_peerlabel are now protected byrwatson2004-06-131-0/+2
| | | | | | | | | | | | | 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-1/+1
| | | | more easily mechanically distinguished from 'struct at_ifaddr'.
* Since I have my hands all over netatalk adding locking and restructuringrwatson2004-03-221-49/+49
| | | | | | | | | | 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-1/+1
|
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-4/+4
| | | | | | | | | | | | | 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)
* More checking of M_PREPEND() return values: pass through link-layerrwatson2003-08-291-0/+2
| | | | | Appletalk code. These changes are untested since I don't have an Appletalk environment.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-2/+2
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* 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
* * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.bmilekic2000-12-211-2/+2
| | | | | | | | | | | | | | | | | | This is because calls with M_WAIT (now M_TRYWAIT) may not wait forever when nothing is available for allocation, and may end up returning NULL. Hopefully we now communicate more of the right thing to developers and make it very clear that it's necessary to check whether calls with M_(TRY)WAIT also resulted in a failed allocation. M_TRYWAIT basically means "try harder, block if necessary, but don't necessarily wait forever." The time spent blocking is tunable with the kern.ipc.mbuf_wait sysctl. M_WAIT is now deprecated but still defined for the next little while. * Fix a typo in a comment in mbuf.h * Fix some code that was actually passing the mbuf subsystem's M_WAIT to malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the value of the M_WAIT flag, this could have became a big problem.
* Just need to pass the address family to if_simloop(), not the whole sockaddr.archie2000-05-241-1/+3
|
* fix broken loopback code for ddp (again)julian1998-08-041-4/+37
| | | | Submitted by: Stefan Bethke <stb@hanse.de>
* Fix braino in last commit.julian1998-07-131-1/+1
| | | | Not even sure how I got this commit in as it didn't even compile.
* Slight optimisation. Don't do the same calculation twice.julian1998-07-091-17/+14
|
* Go through the loopback code with a broom..julian1998-06-121-0/+9
| | | | | | | | | | | | | | | | Remove lots'o'hacks. looutput is now static. Other callers who want to use loopback to allow shortcutting should call the special entrypoint for this, if_simloop(), which is specifically designed for this purpose. Using looutput for this purpose was problematic, particularly with bpf and trying to keep track of whether one should be using the charateristics of the loopback interface or the interface (e.g. if_ethersubr.c) that was requesting the loopback. There was a whole class of errors due to this mis-use each of which had hacks to cover them up. Consists largly of hack removal :-)
* Remove stray debug message.steve1998-05-241-1/+0
| | | | PR: 6722
* Fix various problems with netatalk kernel support.julian1997-10-291-3/+3
| | | | | | | | 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-6/+0
|
* Cleaned up a little.bde1997-09-071-1/+0
|
* Add a per-interface-address pointer to a function that can be suppliedjulian1997-08-281-3/+19
| | | | | | | | | | | | by a protocol, to detirmine if an address matches the net this address is part of. This is needed by protocols for which netmasks "just don't work", for example appletalk. Also add the code in appletalk to make use of this new feature. Thsi fixes one of the longest standing bugs in appletalk. The inability to talk to machines to which the path is via a router which is on a different net, but the same netrange, as your interface. Protocols that do not supply this function (e.g. IP) should not be affected.
* make the netatalk output routine matcy the prtotype used in thejulian1997-03-051-1/+4
| | | | protocol structure. Silences a warning from Gcc.
* Updated #includes to 4.4Lite style.bde1996-09-101-5/+5
|
* Submitted by: archie@whistle.comjulian1996-07-231-123/+3
| | | | appletalk cleanups
* Obtained from: netatalk distribution netatalk@itd.umich.edujulian1996-05-241-0/+298
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