summaryrefslogtreecommitdiffstats
path: root/sys/netatalk/at_control.c
Commit message (Collapse)AuthorAgeFilesLines
* Reverse misordered unlock and lock in at_control for netatalk phase Irwatson2009-08-121-2/+2
| | | | | | | addresses. Submitted by: Russell Cattelan <cattelan at thebarn.com> Approved by: re (kib)
* Use queue(9) instead of hand-crafted link lists for the global netatalkrwatson2009-06-241-43/+25
| | | | | | | address list. Generally follow the style and convention of similar parts in netinet. MFC after: 6 weeks
* Printf fewer warnings when adding a route to an atalk address fails;rwatson2009-06-241-10/+2
| | | | | | userspace will print the error. MFC after: 3 days
* Break at_ifawithnet() into two variants:rwatson2009-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
* Add a global rwlock, at_ifaddr_rw, to protect the global netatalkrwatson2009-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
* Clean up common ifaddr management:rwatson2009-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
* Lock interface address list lock around ifaddr inserts and deletesrwatson2009-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
* Use privilege PRIV_NET_ADDIFADDR rather than suser() to authorizerwatson2007-02-191-1/+2
| | | | adding a netatalk address to an interface.
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-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>
* Convert the aa_ifaddr timeout to a callout, and run the aarprobe calloutrwatson2005-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
* /* -> /*- for license, minor formatting changes, insert COPYRIGHT into filesimp2005-01-071-1/+22
|
* Further function forward declaration white space tweaks.rwatson2004-07-191-14/+15
|
* Re-style at_control.c to bring it closer to style(9), primarily withrwatson2004-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.
* Remove spl's from netatalk in preparation to merge locking.rwatson2004-07-121-7/+1
|
* Rename 'at_ifaddr' list to 'at_ifaddr_list' so that the variable isrwatson2004-03-221-12/+12
| | | | 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).
* Since I have my hands all over netatalk adding locking and restructuringrwatson2004-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)/
* Spell "(struct foo *)0" as "NULL".rwatson2004-03-211-6/+6
|
* Eliminate a duplicate free when deleting an interface address. Thissam2003-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)
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Lock up ifaddr reference counts.hsu2002-12-181-11/+2
|
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-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@
* KSE Milestone 2julian2001-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
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-2/+1
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Move suser() and suser_xxx() prototypes and a related #define fromphk2000-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>.
* Suser() simplification:phk1999-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.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-2/+2
| | | | kernel compile
* Typo fix: teh --> (the|they)alex1998-07-301-1/+1
|
* This commit fixes various 64bit portability problems required fordfr1998-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.
* Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.des1998-04-171-1/+1
|
* Eradicate the variable "time" from the kernel, using various measures.phk1998-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
* Fix various problems with netatalk kernel support.julian1997-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.
* Update for new callout interface.gibbs1997-09-211-1/+1
|
* Removed unused #includes.bde1997-09-071-6/+0
|
* Fixed sloppy common-style declarations.bde1997-09-071-0/+2
|
* Added used #include - don't depend on <sys/mbuf.h> includingbde1997-09-021-0/+1
| | | | <sys/malloc.h> (unless we only use the bogusly shared M*WAIT flags).
* Add a per-interface-address pointer to a function that can be suppliedjulian1997-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.
* First cut at patches to make appletalk compile againjulian1997-05-131-1/+2
| | | | after the dissapearance of the USRREQ() entrypoint.
* Fixed the type of timeout functions and removed casts that hid thebde1997-04-201-1/+1
| | | | type mismatches. There was no problem in practice (at least on 386's).
* Don't include <sys/ioctl.h> in the kernel. Stage 2: includebde1997-03-241-1/+1
| | | | <sys/sockio.h> instead of <sys/ioctl.h> in network files.
* Convert the interface address and IP interface address structureswollman1996-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).
* bzero the entire at_ifaddr struct we malloc, not just the first part of it..julian1996-09-111-1/+1
|
* chnages to bring atlak a bit more into the BSD4.4 world and tojulian1996-09-111-19/+33
| | | | | (more) properly keep track of the allocation and freeing of interface address structures.
* Updated #includes to 4.4Lite style.bde1996-09-101-4/+4
|
* allow a new loopback route to overwrite an old one..julian1996-09-031-5/+10
| | | | this allows the atalkd to be restarted.. a better fix will come later.
* wow we can even make net ranges go away now (how sophisticated!)julian1996-08-311-55/+44
|
* Add code to automaticall support subnets on ethertalk networksjulian1996-08-311-98/+56
| | | | | | | Subnets are represented in the routing table as a set of binary routing nets using the standard netmask algorythm. The code produces the minimum possible set of standard netmasks and net addresses to be able to represent a given netrange.
* Massively COMMENT at_control.cjulian1996-08-291-41/+263
| | | | | | | | | and fix some bugs.. also fix a bug in aarp.c that didn't take netranges into account. default routes now work with appletalk, which is a poor-man's way of being able to access netranges if you only have one network :) Hopefully the full netranges fix will happen soon.
* fix a broken atalk stack..julian1996-08-191-3/+16
| | | | | the lat commits (3 weeks ago ) broke this, and I'm only now getting complaints.. oops!
OpenPOWER on IntegriCloud