summaryrefslogtreecommitdiff
path: root/sys/netatalk/at_control.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove AppleTalk support.Gleb Smirnoff2014-03-141-881/+0
| | | | | | | | | | | | | AppleTalk was a network transport protocol for Apple Macintosh devices in 80s and then 90s. Starting with Mac OS X in 2000 the AppleTalk was a legacy protocol and primary networking protocol is TCP/IP. The last Mac OS X release to support AppleTalk happened in 2009. The same year routing equipment vendors (namely Cisco) end their support. Thus, AppleTalk won't be supported in FreeBSD 11.0-RELEASE. Notes: svn path=/head/; revision=263152
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-10-261-0/+1
| | | | | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257176
* Remove ifa_init() and provide ifa_alloc() that will allocate and setupGleb Smirnoff2013-10-151-9/+3
| | | | | | | | | | struct ifaddr internally. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=256519
* Add const qualifier to the dst parameter of the ifnet if_output method.Gleb Smirnoff2013-04-261-1/+1
| | | | Notes: svn path=/head/; revision=249925
* Convert all users of IF_ADDR_LOCK to use new locking macros that specifyJohn Baldwin2012-01-051-4/+4
| | | | | | | | | | either a read lock or write lock. Reviewed by: bz MFC after: 2 weeks Notes: svn path=/head/; revision=229621
* Reverse misordered unlock and lock in at_control for netatalk phase IRobert Watson2009-08-121-2/+2
| | | | | | | | | | addresses. Submitted by: Russell Cattelan <cattelan at thebarn.com> Approved by: re (kib) Notes: svn path=/head/; revision=196121
* Use queue(9) instead of hand-crafted link lists for the global netatalkRobert Watson2009-06-241-43/+25
| | | | | | | | | | address list. Generally follow the style and convention of similar parts in netinet. MFC after: 6 weeks Notes: svn path=/head/; revision=194913
* Printf fewer warnings when adding a route to an atalk address fails;Robert Watson2009-06-241-10/+2
| | | | | | | | | userspace will print the error. MFC after: 3 days Notes: svn path=/head/; revision=194822
* Break at_ifawithnet() into two variants:Robert Watson2009-06-241-81/+117
| | | | | | | | | | | | | | | | | | - at_ifawithnet(), which acquires an locks it needs and returns an at_ifaddr reference. - at_ifawithnet_locked(), which relies on the caller locking at_ifaddr_list, and returns a pointer rather than a reference. Update various consumers to prefer one or the other, including ether and fddi output, to properly release at_ifaddr references. Rework at_control() to manage locking and references in a manner identical to in_control(). MFC after: 6 weeks Notes: svn path=/head/; revision=194819
* Add a global rwlock, at_ifaddr_rw, to protect the global netatalkRobert Watson2009-06-221-47/+53
| | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=194619
* Clean up common ifaddr management:Robert Watson2009-06-211-3/+2
| | | | | | | | | | | | | | | | | - Unify reference count and lock initialization in a single function, ifa_init(). - Move tear-down from a macro (IFAFREE) to a function ifa_free(). - Move reference count bump from a macro (IFAREF) to a function ifa_ref(). - Instead of using a u_int protected by a mutex to refcount(9) for reference count management. The ifa_mtx is now used for exactly one ioctl, and possibly should be removed. MFC after: 3 weeks Notes: svn path=/head/; revision=194602
* Lock interface address list lock around ifaddr inserts and deletesRobert Watson2009-04-191-1/+5
| | | | | | | | | | in at_control(). This locking is not yet complete but should prevent some classes of race conditions. MFC after: 2 weeks Notes: svn path=/head/; revision=191281
* Use privilege PRIV_NET_ADDIFADDR rather than suser() to authorizeRobert Watson2007-02-191-1/+2
| | | | | | | adding a netatalk address to an interface. Notes: svn path=/head/; revision=166833
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningRobert Watson2006-11-061-0/+2
| | | | | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=164033
* Convert the aa_ifaddr timeout to a callout, and run the aarprobe calloutRobert Watson2005-02-221-4/+8
| | | | | | | | | | MPSAFE. Acquire the aarptab_mtx to make sure that the callout and msleep in the ioctl thread don't race. MFC after: 1 week Notes: svn path=/head/; revision=142226
* /* -> /*- for license, minor formatting changes, insert COPYRIGHT into filesWarner Losh2005-01-071-1/+22
| | | | Notes: svn path=/head/; revision=139827
* Further function forward declaration white space tweaks.Robert Watson2004-07-191-14/+15
| | | | Notes: svn path=/head/; revision=132411
* Re-style at_control.c to bring it closer to style(9), primarily withRobert Watson2004-07-191-606/+594
| | | | | | | | | regard to function prototypes and indentation. The lack of indentation in if clauses and case statements made this code extremely difficult to read. Notes: svn path=/head/; revision=132410
* Remove spl's from netatalk in preparation to merge locking.Robert Watson2004-07-121-7/+1
| | | | Notes: svn path=/head/; revision=132009
* Rename 'at_ifaddr' list to 'at_ifaddr_list' so that the variable isRobert Watson2004-03-221-12/+12
| | | | | | | more easily mechanically distinguished from 'struct at_ifaddr'. Notes: svn path=/head/; revision=127292
* Compare pointers with NULL rather than 0, or treating them as boolans inRobert Watson2004-03-221-2/+2
| | | | | | | | | | if statements. at_rmx gets a $FreeBSD$ out of the deal also (this code appears to be unused). Notes: svn path=/head/; revision=127291
* Since I have my hands all over netatalk adding locking and restructuringRobert Watson2004-03-221-152/+152
| | | | | | | | | | | | | 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)/ Notes: svn path=/head/; revision=127288
* Spell "(struct foo *)0" as "NULL".Robert Watson2004-03-211-6/+6
| | | | Notes: svn path=/head/; revision=127255
* Eliminate a duplicate free when deleting an interface address. ThisSam Leffler2003-11-281-11/+1
| | | | | | | | | | | caused crashes, typically during shutdown, because the second free referenced a mutex that had been destroyed. Tested by: several Approved by: re (scottl) Notes: svn path=/head/; revision=123018
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-1/+1
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-1/+1
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Lock up ifaddr reference counts.Jeffrey Hsu2002-12-181-11/+2
| | | | Notes: svn path=/head/; revision=108033
* Change the suser() API to take advantage of td_ucred as well as do aJohn Baldwin2002-04-011-1/+1
| | | | | | | | | | | | | | | 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@ Notes: svn path=/head/; revision=93593
* KSE Milestone 2Julian Elischer2001-09-121-2/+2
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=83366
* Convert more malloc+bzero to malloc+M_ZERO.David Malone2000-12-081-2/+1
| | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Notes: svn path=/head/; revision=69781
* Move suser() and suser_xxx() prototypes and a related #define fromPoul-Henning Kamp2000-10-291-1/+2
| | | | | | | | | | | | <sys/proc.h> to <sys/systm.h>. Correctly document the #includes needed in the manpage. Add one now needed #include of <sys/systm.h>. Remove the consequent 48 unused #includes of <sys/proc.h>. Notes: svn path=/head/; revision=67893
* Suser() simplification:Poul-Henning Kamp1999-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=46112
* Fix warnings in preparation for adding -Wall -Wcast-qual to theMatthew Dillon1999-01-271-2/+2
| | | | | | | kernel compile Notes: svn path=/head/; revision=43305
* Typo fix: teh --> (the|they)Alexander Langer1998-07-301-1/+1
| | | | Notes: svn path=/head/; revision=37965
* This commit fixes various 64bit portability problems required forDoug Rabson1998-06-071-1/+1
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=36735
* Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.Dag-Erling Smørgrav1998-04-171-1/+1
| | | | Notes: svn path=/head/; revision=35256
* Eradicate the variable "time" from the kernel, using various measures.Poul-Henning Kamp1998-03-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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 Notes: svn path=/head/; revision=34961
* Fix various problems with netatalk kernel support.Julian Elischer1997-10-291-4/+4
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=30822
* Update for new callout interface.Justin T. Gibbs1997-09-211-1/+1
| | | | Notes: svn path=/head/; revision=29681
* Removed unused #includes.Bruce Evans1997-09-071-6/+0
| | | | Notes: svn path=/head/; revision=29188
* Fixed sloppy common-style declarations.Bruce Evans1997-09-071-0/+2
| | | | Notes: svn path=/head/; revision=29182
* Added used #include - don't depend on <sys/mbuf.h> includingBruce Evans1997-09-021-0/+1
| | | | | | | <sys/malloc.h> (unless we only use the bogusly shared M*WAIT flags). Notes: svn path=/head/; revision=29024
* Add a per-interface-address pointer to a function that can be suppliedJulian Elischer1997-08-281-1/+43
| | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=28845
* First cut at patches to make appletalk compile againJulian Elischer1997-05-131-1/+2
| | | | | | | after the dissapearance of the USRREQ() entrypoint. Notes: svn path=/head/; revision=25791
* Fixed the type of timeout functions and removed casts that hid theBruce Evans1997-04-201-1/+1
| | | | | | | type mismatches. There was no problem in practice (at least on 386's). Notes: svn path=/head/; revision=25047
* Don't include <sys/ioctl.h> in the kernel. Stage 2: includeBruce Evans1997-03-241-1/+1
| | | | | | | <sys/sockio.h> instead of <sys/ioctl.h> in network files. Notes: svn path=/head/; revision=24204
* Convert the interface address and IP interface address structuresGarrett Wollman1996-12-131-27/+8
| | | | | | | | | to TAILQs. Fix places which referenced these for no good reason that I can see (the references remain, but were fixed to compile again; they are still questionable). Notes: svn path=/head/; revision=20407
* bzero the entire at_ifaddr struct we malloc, not just the first part of it..Julian Elischer1996-09-111-1/+1
| | | | Notes: svn path=/head/; revision=18244
* chnages to bring atlak a bit more into the BSD4.4 world and toJulian Elischer1996-09-111-19/+33
| | | | | | | | (more) properly keep track of the allocation and freeing of interface address structures. Notes: svn path=/head/; revision=18240
* Updated #includes to 4.4Lite style.Bruce Evans1996-09-101-4/+4
| | | | Notes: svn path=/head/; revision=18207